Type of the user-defined context.
The context is an user-defined value which can be passed to your HTTP client implementation to be able to tweak some internal details about the underlying request/connection used to get an HTTP response.
For instance, an HTTP implementation can optionally require some value such as the internal buffer size or a time-out value, etc. The interface wants to allow the implementer to pass such information via the ctx
type.
In others words, anything optionnaly needed to initiate/do the HTTP request and that is not described over this interface (by arguments, types, etc.) can be passed via the user-defined ctx
type.
For instance, MirageOS uses this ctx
as a ressource allocator to initiate a TCP/IP connection or a TLS connection - and, by this way, it fully abstracts the HTTP client implementation over the TCP/IP and the TLS stack (for more details, see mimic
).
Of course, ctx = unit
if you don't need to pass extra-information when you want to do an HTTP request/connection.