sig
  type etag = string
  type url_path = string list
  module Cookies :
    sig
      type key = url_path
      type +'a t
      val empty : 'a t
      val is_empty : 'a t -> bool
      val mem : key -> 'a t -> bool
      val add : key -> '-> 'a t -> 'a t
      val singleton : key -> '-> 'a t
      val remove : key -> 'a t -> 'a t
      val merge :
        (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
      val compare : ('-> '-> int) -> 'a t -> 'a t -> int
      val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val for_all : (key -> '-> bool) -> 'a t -> bool
      val exists : (key -> '-> bool) -> 'a t -> bool
      val filter : (key -> '-> bool) -> 'a t -> 'a t
      val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
      val cardinal : 'a t -> int
      val bindings : 'a t -> (key * 'a) list
      val min_binding : 'a t -> key * 'a
      val max_binding : 'a t -> key * 'a
      val choose : 'a t -> key * 'a
      val split : key -> 'a t -> 'a t * 'a option * 'a t
      val find : key -> 'a t -> 'a
      val map : ('-> 'b) -> 'a t -> 'b t
      val mapi : (key -> '-> 'b) -> 'a t -> 'b t
    end
  module Cookievalues :
    sig
      type key = string
      type +'a t
      val empty : 'a t
      val is_empty : 'a t -> bool
      val mem : key -> 'a t -> bool
      val add : key -> '-> 'a t -> 'a t
      val singleton : key -> '-> 'a t
      val remove : key -> 'a t -> 'a t
      val merge :
        (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
      val compare : ('-> '-> int) -> 'a t -> 'a t -> int
      val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val for_all : (key -> '-> bool) -> 'a t -> bool
      val exists : (key -> '-> bool) -> 'a t -> bool
      val filter : (key -> '-> bool) -> 'a t -> 'a t
      val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
      val cardinal : 'a t -> int
      val bindings : 'a t -> (key * 'a) list
      val min_binding : 'a t -> key * 'a
      val max_binding : 'a t -> key * 'a
      val choose : 'a t -> key * 'a
      val split : key -> 'a t -> 'a t * 'a option * 'a t
      val find : key -> 'a t -> 'a
      val map : ('-> 'b) -> 'a t -> 'b t
      val mapi : (key -> '-> 'b) -> 'a t -> 'b t
    end
  type cookie = OSet of float option * string * bool | OUnset
  type cookieset =
      Ocsigen_http_frame.cookie Ocsigen_http_frame.Cookievalues.t
      Ocsigen_http_frame.Cookies.t
  val add_cookie :
    Ocsigen_http_frame.url_path ->
    string ->
    Ocsigen_http_frame.cookie ->
    Ocsigen_http_frame.cookieset -> Ocsigen_http_frame.cookieset
  val add_cookies :
    Ocsigen_http_frame.cookie Ocsigen_http_frame.Cookievalues.t
    Ocsigen_http_frame.Cookies.t ->
    Ocsigen_http_frame.cookie Ocsigen_http_frame.Cookievalues.t
    Ocsigen_http_frame.Cookies.t ->
    Ocsigen_http_frame.cookie Ocsigen_http_frame.Cookievalues.t
    Ocsigen_http_frame.Cookies.t
  val compute_new_ri_cookies :
    float ->
    string list ->
    string Ocsigen_http_frame.Cookievalues.t ->
    Ocsigen_http_frame.cookie Ocsigen_http_frame.Cookievalues.t
    Ocsigen_http_frame.Cookies.t -> string Ocsigen_http_frame.Cookievalues.t
  type result = {
    res_cookies : Ocsigen_http_frame.cookieset;
    res_lastmodified : float option;
    res_etag : Ocsigen_http_frame.etag option;
    res_code : int;
    res_stream : string Ocsigen_stream.t;
    res_stop_stream : unit -> unit Lwt.t;
    res_content_length : int64 option;
    res_content_type : string option;
    res_headers : Http_headers.t;
    res_charset : string option;
    res_location : string option;
  }
  val default_result : unit -> Ocsigen_http_frame.result
  val empty_result : unit -> Ocsigen_http_frame.result
  module type HTTP_CONTENT =
    sig
      type t
      val result_of_content :
        Ocsigen_http_frame.HTTP_CONTENT.t -> Ocsigen_http_frame.result Lwt.t
      val get_etag :
        Ocsigen_http_frame.HTTP_CONTENT.t -> Ocsigen_http_frame.etag option
    end
  module Http_header :
    sig
      type http_method =
          GET
        | POST
        | HEAD
        | PUT
        | DELETE
        | TRACE
        | OPTIONS
        | CONNECT
        | LINK
        | UNLINK
        | PATCH
      type http_mode =
          Query of (Ocsigen_http_frame.Http_header.http_method * string)
        | Answer of int
        | Nofirstline
      type proto = HTTP10 | HTTP11
      type http_header = {
        mode : Ocsigen_http_frame.Http_header.http_mode;
        proto : Ocsigen_http_frame.Http_header.proto;
        headers : Http_headers.t;
      }
      val get_firstline :
        Ocsigen_http_frame.Http_header.http_header ->
        Ocsigen_http_frame.Http_header.http_mode
      val get_headers :
        Ocsigen_http_frame.Http_header.http_header -> Http_headers.t
      val get_headers_value :
        Ocsigen_http_frame.Http_header.http_header ->
        Http_headers.name -> string
      val get_headers_values :
        Ocsigen_http_frame.Http_header.http_header ->
        Http_headers.name -> string list
      val get_proto :
        Ocsigen_http_frame.Http_header.http_header ->
        Ocsigen_http_frame.Http_header.proto
      val add_headers :
        Ocsigen_http_frame.Http_header.http_header ->
        Http_headers.name ->
        string -> Ocsigen_http_frame.Http_header.http_header
    end
  module Http_error :
    sig
      exception Http_exception of int * string option * Http_headers.t option
      val expl_of_code : int -> string
      val display_http_exception : exn -> unit
      val string_of_http_exception : exn -> string
    end
  type t = {
    header : Ocsigen_http_frame.Http_header.http_header;
    content : string Ocsigen_stream.t option;
    abort : unit -> unit Lwt.t;
  }
end