def stream.one.of
bend-kit-http@0.38.5.0 · http.bend:5072
import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-url@0.4.1.0/url.bend as Url
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
5072
5073def stream.one.of(p: Pool, +method: String, +url: Url.Abs, headers: Map<&2, List<&2, String>>, sent: Map<&2, List<&2, String>>,
5074 +ms: U32, r: Bytes.Bytes & Bytes.Bytes, cert: Maybe<&2, Cert>, +ca: String) -> IO(Pool & Hop & Result<&1, &1, Err, Stream>):
5075 Url.Abs{+scheme, +host, +port, target} = url
5076 (body, wire) = r
5077 do IO<Pool & Hop & Result<&1, &1, Err, Stream>>:
5078 choice : Maybe<&2, Proxy> <- proxy.select(scheme, host, port)
5079 got : Pool & Result<&1, &1, Err, Stream> <-
5080 stream.origin(p, method, ms, sent, wire, Url.host_field(url), url,
5081 pool.scheme.ok(url), cert, ca, choice)
5082 return stream.one.back(Hop{method, url, headers, body}, got)