package sihl-type

  1. Overview
  2. Docs
include module type of struct include Opium.Response end
type t = Rock.Response.t = {
  1. version : Opium__.Version.t;
  2. status : Opium__.Status.t;
  3. reason : string option;
  4. headers : Opium__.Headers.t;
  5. body : Opium__.Body.t;
  6. env : Opium__.Context.t;
}
val make : ?version:Opium__.Version.t -> ?status:Opium__.Status.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?body:Opium__.Body.t -> ?env:Opium__.Context.t -> unit -> t
val of_plain_text : ?version:Opium__.Version.t -> ?status:Opium__.Status.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?env:Opium__.Context.t -> string -> t
val of_json : ?version:Opium__.Version.t -> ?status:Opium__.Status.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?env:Opium__.Context.t -> Yojson.Safe.t -> t
val of_html : ?version:Opium__.Version.t -> ?status:Opium__.Status.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?env:Opium__.Context.t -> ?indent:bool -> [ `Html ] Tyxml_html.elt -> t
val of_xml : ?version:Opium__.Version.t -> ?status:Opium__.Status.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?env:Opium__.Context.t -> ?indent:bool -> Tyxml_xml.elt -> t
val of_svg : ?version:Opium__.Version.t -> ?status:Opium__.Status.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?env:Opium__.Context.t -> ?indent:bool -> [ `Svg ] Tyxml_svg.elt -> t
val redirect_to : ?status:Opium__.Status.redirection -> ?version:Opium__.Version.t -> ?reason:string -> ?headers:Opium__.Headers.t -> ?env:Opium__.Context.t -> string -> t
val to_json : t -> Yojson.Safe.t option Lwt.t
val to_json_exn : t -> Yojson.Safe.t Lwt.t
val to_plain_text : t -> string Lwt.t
val status : t -> Opium__.Status.t
val set_status : Opium__.Status.t -> t -> t
val header : string -> t -> string option
val headers : string -> t -> string list
val add_header : (string * string) -> t -> t
val add_header_or_replace : (string * string) -> t -> t
val add_header_unless_exists : (string * string) -> t -> t
val add_headers : (string * string) list -> t -> t
val add_headers_or_replace : (string * string) list -> t -> t
val add_headers_unless_exists : (string * string) list -> t -> t
val remove_header : string -> t -> t
val content_type : t -> string option
val set_content_type : string -> t -> t
val etag : t -> string option
val set_etag : string -> t -> t
val location : t -> string option
val set_location : string -> t -> t
val cache_control : t -> string option
val set_cache_control : string -> t -> t
val cookies : ?signed_with:Opium__.Cookie.Signer.t -> t -> Opium__.Cookie.t list
val sexp_of_t : t -> Sexplib0.Sexp.t
val pp : Stdlib.Format.formatter -> t -> unit
val pp_hum : Stdlib.Format.formatter -> t -> unit
exception Isnt_a_file
val log_src : Logs.src
module Logs : Logs.LOG
val read : Lwt_io.file_name -> (Opium.Body.t, [> `Not_found ]) Stdlib.result Lwt.t
val of_file : Lwt_io.file_name -> ?version:Httpaf.Version.t -> ?reason:string -> ?headers:Httpaf.Headers.t -> ?env:Opium.Context.t -> unit -> Rock.Response.t Lwt.t
OCaml

Innovation. Community. Security.