def once

bend-kit-hairpin@0.13.0.1 · hairpin.bend:143

import bend-kit-hairpin@0.13.0.1/hairpin.bend as Hairpin
import Base
import bend-kit-http@0.38.1.1/http.bend as Http
import bend-kit-url@0.4.1.0/url.bend as Url
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

143# One try: the redirect loop on the pool, with the jar, the certificate, and the CA file, then the body decoded.
144def once(+ms: U32, +mode: Http.Mode, +cert: Maybe<&2, Http.Cert>, +ca: String, +enc: String, p: Http.Pool, j: Maybe<&2, Http.Jar>,
145    +method: String, +u: Maybe<&2, Url.Abs>, +headers: Map<&2, List<&2, String>>, body: Bytes.Bytes) ->
146    IO(Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, Http.Res>):
147  do IO<Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, Http.Res>>:
148    now : Maybe<&2, Http.Jar> <- jar.now(j)
149    x : Http.Pool & Result<&1, &1, Http.Err, Http.Res> & Maybe<&2, Http.Jar> <-
150      Http.pool.hops(mode, ms, Http.Hops{p, Http.fetch.start(method, headers, body, u, enc), cert, now, ca})
151    once.final(enc, x)

Uses (22)

Used by (1)