package sonet

  1. Overview
  2. Docs
type state
type header_callback = Response_header.t -> Response_header.t
val init_state : ?header_callback:header_callback -> ?payload_callback:payload_callback -> unit -> state
val num_bytes_parsed : state -> int64
type error =
  1. | Internal_error of string
val string_of_error : error -> string
exception Http_error of error
type t = {
  1. response : Response_header.t;
  2. payload : Payload.t option;
}
type parse_result =
  1. | Result of t * int
  2. | Parse_incomplete of state
  3. | Error of string
val parse : state -> string -> parse_result
val parse_substring : state -> string -> int -> int -> parse_result
val get_parse_result : state -> t option
val connection_closed : state -> unit
val serialize : Buffer.t -> t -> unit
val make_response : ?payload:Payload.t -> headers:header_fields -> Response_header.status -> t
OCaml

Innovation. Community. Security.