Module Http.Private

val trim_ows : string -> string

trim_ows trims starting and ending HTTP ows.

val decode_request_line : bytes -> first:int -> crlf:int -> meth * string * version

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.

val decode_header_field : bytes -> first:int -> crlf:int -> name * 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 encode_resp_header_section : version -> status -> string -> headers -> string

encode_resp_header_section v st rason_phrase hs is the header section for a response with the given parameters. This has the final double CRLF.