Connector.Private
Private codecs (unstable).
Warning. This API is unstable. It may change between minor versions of the library. Use at your own risk.
decode_request_line b ~first ~crlf
decodes a request line that starts at first
and whose ending CRLF starts at crlf
. Raises Failure
on errors.
decode_status_line b ~first ~crlf
decodes a status line that starts at first
and whose ending CRLF starts at crlf
. Raises Failure
on errors.
val decode_header_field :
bytes ->
first:int ->
crlf:int ->
Headers.Name.t * string
decode_header_field b ~first ~crlf
decodes a header field that starts at first
and whose ending CRLF starts at crlf
. Raises Failure
on errors.
val decode_headers : bytes -> crlfs:int list -> Headers.t
decode_headers b crlfs
decodes the headers. b
has the header section with the start line (either request or status line) or finished by the first crlfs
.
val decode_http11_response : bytes -> first:int -> Response.t
decode_http11_response b ~first
decodes an HTTP/1.1 full response from b
starting at first
. The result satisfies client responses. Raises Failure
on errors.
encode_http11_response_head
is the HTTP/1.1 head for a response with the given parameters. This has the final double CRLF.