def stream.origin

bend-kit-http@0.38.2.0 · http.bend:5051

import bend-kit-http@0.38.2.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

5051# cert and ca: the client identity and trusted CA file for this origin.
5052def stream.origin(p: Pool, +method: String, +ms: U32, headers: Map<&2, List<&2, String>>,
5053    body: Bytes.Bytes, hf: String, a: Url.Abs, known: Bool,
5054    cert: Maybe<&2, Cert>, +ca: String, choice: Maybe<&2, Proxy>) ->
5055    IO(Pool & Result<&1, &1, Err, Stream>):
5056  Url.Abs{scheme, host, port, target} = a
5057  match known:
5058    case False{}:
5059      IO.pure(Pool & Result<&1, &1, Err, Stream>, (p, Fail{ErrUrl{}}))
5060    case True{}:
5061      stream.origin.choice(p, method, ms, headers, body, hf, scheme, host, port,
5062        target, cert, ca, choice)

Uses (19)

Used by (1)