Module Ocsigen_response
type tmodule Body : sig ... endval make :
?body:Body.t ->
?cookies:Ocsigen_cookie_map.t ->
Cohttp.Response.t ->
tMake a response from a Cohttp.Response.t. Note that the transfer-encoding header is not taken into account if it is set to chunked, use add_header. This is because Cohttp.Response.make sets this header by default, which interferes with the transfer-encoding carried by the body.
Like make but with an interface similar to Cohttp_lwt_unix.Server.respond.
val respond_string :
?headers:Cohttp.Header.t ->
status:Http.Status.t ->
body:string ->
unit ->
tLike respond but with a fixed string body.
val respond_error :
?headers:Cohttp.Header.t ->
?status:Http.Status.t ->
body:string ->
unit ->
tLike respond_string with "Error: " appended to the body. The default status is `Internal_server_error.
val respond_file :
?headers:Cohttp.Header.t ->
?status:Http.Status.t ->
string ->
t Lwt.tRespond with the content of a file. The content type is guessed using Magic_mime.
val update :
?response:Cohttp.Response.t ->
?body:Body.t ->
?cookies:Ocsigen_cookie_map.t ->
t ->
tval of_cohttp :
?cookies:Ocsigen_cookie_map.t ->
(Cohttp.Response.t * Cohttp_lwt.Body.t) ->
tval to_response_expert :
t ->
Cohttp.Response.t * ('ic -> Lwt_io.output_channel -> unit Lwt.t)Response for Cohttp_lwt_unix.Server.make_expert. Set cookie headers.
val response : t -> Cohttp.Response.tRaw response without cookie headers set.
val status : t -> Cohttp.Code.statusval cookies : t -> Ocsigen_cookie_map.tval add_cookies : t -> Ocsigen_cookie_map.t -> tval header : t -> Ocsigen_header.Name.t -> string optionval header_multi : t -> Ocsigen_header.Name.t -> string listval add_header : t -> Ocsigen_header.Name.t -> string -> tval add_header_multi : t -> Ocsigen_header.Name.t -> string list -> tval replace_header : t -> Ocsigen_header.Name.t -> string -> tval replace_headers : t -> (Ocsigen_header.Name.t * string) list -> tval remove_header : t -> Ocsigen_header.Name.t -> t