def wire.exchange.octets

emerging-ezhttp@0.21.0.0 · src/wirespec.bend:107

import emerging-ezhttp@0.21.0.0/src/wirespec.bend as Wirespec
import Base
import emerging-ezhttp@0.21.0.0/src/http.bend as Http
import emerging-ezhttp@0.21.0.0/src/url.bend as Url

107# a request with n octets of body to a URL that came apart: the request text
108# ends at the blank line, and the octets go after it
109def wire.exchange.octets(+method: String, l: Url.Loc,
110  headers: List<&2, Http.Header>, n: Nat) -> Exchange:
111  match l:
112    case Url.Bad{why}:
113      NoUrl{why}
114    case Url.Loc{scheme, +host, +port, path}:
115      +secure = String.eq(scheme, "https")
116      Exchange{secure, host, port, method,
117        Http.request.head.at(method, secure, host, port, path, headers, n)}

Uses (8)

Used by (1)