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 -> 'a t -> 'a t
val singleton : key -> 'a -> '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 : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val partition : (key -> 'a -> 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 : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
end
type cookie = OSet of float option * string * bool | OUnset
type cookieset =
Ocsigen_http_frame.cookie Ocsigen_lib.String_Table.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_lib.String_Table.t
Ocsigen_http_frame.Cookies.t ->
Ocsigen_http_frame.cookie Ocsigen_lib.String_Table.t
Ocsigen_http_frame.Cookies.t ->
Ocsigen_http_frame.cookie Ocsigen_lib.String_Table.t
Ocsigen_http_frame.Cookies.t
val compute_new_ri_cookies :
float ->
string list ->
string Ocsigen_lib.String_Table.t ->
Ocsigen_http_frame.cookie Ocsigen_lib.String_Table.t
Ocsigen_http_frame.Cookies.t -> string Ocsigen_lib.String_Table.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 *
(string Ocsigen_stream.t -> int64 -> string Ocsigen_stream.step Lwt.t)
option;
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
type options
val result_of_content :
?options:Ocsigen_http_frame.HTTP_CONTENT.options ->
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 = {
frame_header : Ocsigen_http_frame.Http_header.http_header;
frame_content : string Ocsigen_stream.t option;
frame_abort : unit -> unit Lwt.t;
}
end