Cohttp_lwt.S
Portable Lwt implementation of HTTP client and server, without depending on a particular I/O implementation. The various Make
functors must be instantiated by an implementation that provides a concrete IO monad.
module type IO = sig ... end
The IO module is specialized for the Lwt
monad.
module type Net = sig ... end
The Net
module type defines how to connect to a remote node and close the resulting channels to clean up.
module type Sleep = sig ... end
This is compatible with Mirage_time.S
. It may be satisfied by mirage-time-unix Time
or Mirage_time
.
type call =
?headers:Http.Header.t ->
?body:Body.t ->
Http.Method.t ->
Uri.t ->
(Cohttp.Response.t * Body.t) Lwt.t
call ?headers ?body method uri
Function type used to handle http requests
}
on recoverable errors like the remote endpoint closing the connection gracefully. Even non-idempotent requests are guaranteed to not have been processed by the remote endpoint and should be retried. But beware that a `Stream
body
may have been consumed.
module type Connection = sig ... end
The Connection
module handles a single, possibly pipelined, http connection.
module type Connection_cache = sig ... end
A Connection_cache
handles http requests. It not necessarily caches connections.
module type Client = sig ... end
The Client
module is a collection of convenience functions for constructing and processing requests.
module type Server = sig ... end
The Server
module implements a pipelined HTTP/1.1 server.