Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Https_eioSourceTLS/CA setup errors, matching ca-certs' and tls's own error shape. HTTPS connections fail closed if no system CA bundle can be found; certificate verification is never silently disabled.
type https_wrapper =
Uri.t ->
[ Eio.Flow.two_way_ty | Eio.Resource.close_ty ] Eio.Std.r ->
Tls_eio.tThe exact shape cohttp-eio's client expects for its ~https hook.
Return Some wrapper for https:// URIs, None otherwise. HTTPS URIs must include a DNS hostname accepted by domain-name; invalid hosts return Error _ before any TLS handshake. The returned wrapper captures the validated host for SNI/certificate verification.
type request_error = | Invalid_config of stringInvalid timeout, or url is not an absolute http:///https:// URL with a host — rejected before any I/O.
| Tls_setup of stringTLS setup failed for an https:// URL.
| Timeout of floatThe request did not complete within this many seconds.
*)| Response_too_large of intThe response body exceeded max_response_bytes (this case's int). A predictable request-policy outcome, not a transport failure — distinct from Network_error so a caller that wants to treat "the document is too big" differently from "the connection broke" can.
| Network_error of stringConnection failure, or any other transport-level exception.
*)val request :
net:_ Eio.Net.t ->
clock:_ Eio.Time.clock ->
?timeout:float ->
meth:Http.Method.t ->
url:string ->
?headers:(string * string) list ->
?body:string ->
?max_response_bytes:int ->
unit ->
(int * string, request_error) resultA timeout-bounded HTTP request through https_for_uri's TLS wrapper, on cohttp-eio. Returns (status, body) for any response, 2xx or not — callers classify status codes themselves, the same way https_for_uri leaves TLS/certificate policy to its caller. Eio.Cancel.Cancelled is always re-raised, never converted to Error.
Not a general-purpose HTTP client: no retries, no connection pooling (a fresh connection is made per call), no redirect handling. Built for the shape every non-AWS caller in this ecosystem already needed — metrics/log push, schema-registry and admin API calls, JWKS fetch — not as a replacement for cohttp-eio itself. Callers with different needs (SigV4 byte-fidelity, streaming bodies, connection reuse) should keep building their own transport.