package rock

  1. Overview
  2. Docs

Module to create HTTP responses.

type t = {
  1. version : Httpaf.Version.t;
  2. status : Httpaf.Status.t;
  3. reason : string option;
  4. headers : Httpaf.Headers.t;
  5. body : Body.t;
  6. env : Context.t;
}

Constructors

make

val make : ?version:Httpaf.Version.t -> ?status:Httpaf.Status.t -> ?reason:string -> ?headers:Httpaf.Headers.t -> ?body:Body.t -> ?env:Context.t -> unit -> t

make ?version ?status ?reason ?headers ?body ?env () creates a new response from the given values.

By default, the HTTP version will be set to 1.1, the HTTP status to 200 and the response will not contain any header or body.

OCaml

Innovation. Community. Security.