def http.send
emerging-ezhttp@0.21.0.0 · src/client.bend:48
import emerging-ezhttp@0.21.0.0/src/client.bend as Client
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
import emerging-ezhttp@0.21.0.0/src/wire.bend as Wire
import emerging-ezhttp@0.21.0.0/src/wirespec.bend as Spec
48
49
50def http.send(ex: Spec.Exchange, tail: Bytes.Bytes) -> IO(Response):
51 match ex:
52 case Spec.NoUrl{why}:
53 IO.pure(Response, Err{why})
54 case Spec.Exchange{secure, host, port, +method, req}:
55 do IO<Response>:
56 a : Wire.Answer <- Wire.wire.talk(secure, host, port, method, req, tail)
57 IO.pure(Response, http.answer(method, a))