def client.hop

emerging-ezhttp@0.21.0.0 · src/client.bend:103

import emerging-ezhttp@0.21.0.0/src/client.bend as Client
import Base
import emerging-ezhttp@0.21.0.0/src/redirect.bend as Redirect

103# the next hop after a response (redirect.bend), and the response; a failed
104# exchange stops
105def client.hop(left: Nat, url: String, r: Response) -> Redirect.Hop & Response:
106  match r:
107    case Err{why}:
108      (Redirect.Stop{}, Err{why})
109    case Response{+status, +headers, reason, bytes}:
110      (Redirect.redirect.plan(left, url, status, headers),
111        Response{status, headers, reason, bytes})

Uses (7)

Used by (1)