package ohttp
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=6a31dba01d9ee06d1b0115516439d8b0
sha512=c2739c32cf8d44b36ca565052f6b14feaf99a029115e8d94dcd469bd363f7dacd8e401a4ca07c0a3555f0fe5572a37516b489ddd945ee9acae4ceafc29e7dadb
doc/ohttp/Ohttp/Http_message/index.html
Module Ohttp.Http_messageSource
Exchanges of Binary HTTP messages: Ohttp.Client and Ohttp.Gateway with the encoding and decoding of Bhttp around them, and the rules that RFC 9458 adds for what is encapsulated.
val encapsulate_request :
rng:Mirage_crypto_rng.g ->
?preference:Suite.symmetric list ->
?framing:Bhttp.Framing.t ->
?padding:int ->
Key_config.t ->
Bhttp.Request.t ->
(string * Client.response_context, Error.t) resultAn Encapsulated Request for a gateway, and the context for its response.
padding appends zero bytes to the message before it is sealed, which hides its length from the relay and from the network (RFC 9458 Section 6.2.3). Returns Error.t.Continue_expectation for a request that expects 100-continue, and Error.t.Bhttp for an invalid one.
val decapsulate_response :
Client.response_context ->
string ->
(Bhttp.Response.t, Error.t) resultval decapsulate_request :
Gateway.t ->
string ->
((Bhttp.Request.t, Bhttp.Response.t) result * Gateway.response_context,
Error.t)
resultThe request inside an Encapsulated Request, and the context for its response.
RFC 9458 Section 5.2 tells two kinds of failure apart, and so does the result. If the encapsulation cannot be removed, the outer result is an error, to be answered without encapsulation: see Http_binding.Gateway.error_response. If it can, there is a context, and whatever follows must be answered through it, including failures. A request that does not decode, or that expects 100-continue (Section 5.1), is therefore given as Error response: the response to encapsulate in place of one from the target.
val encapsulate_response :
rng:Mirage_crypto_rng.g ->
?framing:Bhttp.Framing.t ->
?padding:int ->
Gateway.response_context ->
Bhttp.Response.t ->
(string, Error.t) resultAn Encapsulated Response. A gateway that gets no response from the target encapsulates one of its own, such as a 504 (RFC 9458 Section 5).
Whether a request has an expect field that lists 100-continue.