Hcs.Response.Prebuilt

hcs · API reference

type t = {
  status : Status.t;
  headers : (string * string) list;
  body : string;
}

Response data prepared once and reused for hot paths.

val create : status:Status.t -> ?headers:(string * string) list -> string -> t

Prepare a string response, including a precomputed content length.

val create_bigstring : 
  status:Status.t ->
  ?headers:(string * string) list ->
  Bigstringaf.t ->
  t

Prepare a bigstring response by materializing it as a string once.