package dream-httpaf

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type error = [
  1. | `Bad_request
  2. | `Bad_gateway
  3. | `Internal_server_error
  4. | `Exn of exn
]
type error_handler = ?request:Request.t -> error -> (Headers.t -> Body.Writer.t) -> unit
module Reader = Parse.Reader
module Writer = Serialize.Writer
type t = {
  1. request : Request.t;
  2. request_body : Body.Reader.t;
  3. reader : Reader.request;
  4. writer : Writer.t;
  5. response_body_buffer : Bigstringaf.t;
  6. error_handler : error_handler;
  7. mutable persistent : bool;
  8. mutable response_state : Response_state.t;
  9. mutable error_code : [ `Ok | error ];
}
val request : t -> Request.t
val request_body : t -> Body.Reader.t
val response : t -> Response.t option
val response_exn : t -> Response.t
val respond_with_string : t -> Response.t -> string -> unit
val respond_with_bigstring : t -> Response.t -> Bigstringaf.t -> unit
val unsafe_respond_with_streaming : flush_headers_immediately:bool -> t -> Response.t -> Body.Writer.t
val respond_with_streaming : ?flush_headers_immediately:bool -> t -> Response.t -> Body.Writer.t
val unsafe_respond_with_upgrade : t -> Headers.t -> (unit -> unit) -> unit
val respond_with_upgrade : t -> Headers.t -> (unit -> unit) -> unit
val report_error : t -> error -> unit
val report_exn : t -> exn -> unit
val try_with : t -> (unit -> 'a) -> (unit, exn) result
val close_request_body : t -> unit
val error_code : t -> [> `Bad_gateway | `Bad_request | `Exn of exn | `Internal_server_error ] option
val persistent_connection : t -> bool
val input_state : t -> Input_state.t
val output_state : t -> Output_state.t
val flush_request_body : t -> unit
val flush_response_body : t -> unit
OCaml

Innovation. Community. Security.