A2a_client.TransportHTTP transport: how the client exchanges one request for one response. Supply your own to add proxies, tracing or test doubles.
type response = {status : int;headers : (string * string) list;body : Eio.Flow.source_ty Eio.Resource.t;}The response body must stay readable until sw is released, and the connection must be released with it.
The Content-Type without parameters, lowercased.
type connection =
[ Eio.Flow.two_way_ty | Eio.Resource.close_ty ] Eio.Resource.ttype https = Uri.t -> connection -> connectionWraps a TCP connection in TLS for the given URL, e.g. with tls-eio.
A new connection per request, closed when the request's switch is released. Honours Cohttp_eio.Client.set_proxies.
val pooled :
?https:https ->
?max_idle_per_host:int ->
?idle_timeout:float ->
sw:Eio.Switch.t ->
clock:_ Eio.Time.Mono.t ->
_ Eio.Net.t ->
tHTTP/1.1 keep-alive: a connection whose response was read to the end goes back to an idle pool when the request's switch is released, and is reused by the next request to the same scheme, host and port. A response that was not read to the end (a finished stream the server has not closed yet, cancellation, an error) is drained in the background for up to 0.1 s; if it does not end by then, its connection is closed instead.
Connections belong to sw, the pool's lifetime; they are all closed when it is released. Each request still holds its connection only until its own switch is released, so streams and concurrent requests each get their own connection.
A request that fails on a reused connection (the server may have closed it meanwhile) is retried once on a new connection. Proxies are not supported.