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 add : key -> 'a -> 'a t -> 'a t
val find : key -> 'a t -> 'a
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
end
module Cookievalues :
sig
type key = string
type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val find : key -> 'a t -> 'a
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
end
type cookie = OSet of float option * string | OUnset
type cookieset =
Http_frame.cookie Http_frame.Cookievalues.t Http_frame.Cookies.t
val add_cookie :
Http_frame.url_path ->
string ->
Http_frame.cookie -> Http_frame.cookieset -> Http_frame.cookieset
val add_cookies :
Http_frame.cookie Http_frame.Cookievalues.t Http_frame.Cookies.t ->
Http_frame.cookie Http_frame.Cookievalues.t Http_frame.Cookies.t ->
Http_frame.cookie Http_frame.Cookievalues.t Http_frame.Cookies.t
val compute_new_ri_cookies :
float ->
string list ->
string Http_frame.Cookievalues.t ->
Http_frame.cookie Http_frame.Cookievalues.t Http_frame.Cookies.t ->
string Http_frame.Cookievalues.t
type result = {
res_cookies : Http_frame.cookieset;
res_lastmodified : float option;
res_etag : Http_frame.etag option;
res_code : int;
res_stream : string Ocsistream.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 -> Http_frame.result
val empty_result : unit -> Http_frame.result
module type HTTP_CONTENT =
sig
type t
val result_of_content :
Http_frame.HTTP_CONTENT.t -> Http_frame.result Lwt.t
val get_etag : Http_frame.HTTP_CONTENT.t -> 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 (Http_frame.Http_header.http_method * string)
| Answer of int
| Nofirstline
type proto = HTTP10 | HTTP11
type http_header = {
mode : Http_frame.Http_header.http_mode;
proto : Http_frame.Http_header.proto;
headers : Http_headers.t;
}
val get_firstline :
Http_frame.Http_header.http_header ->
Http_frame.Http_header.http_mode
val get_headers : Http_frame.Http_header.http_header -> Http_headers.t
val get_headers_value :
Http_frame.Http_header.http_header -> Http_headers.name -> string
val get_headers_values :
Http_frame.Http_header.http_header ->
Http_headers.name -> string list
val get_proto :
Http_frame.Http_header.http_header -> Http_frame.Http_header.proto
val add_headers :
Http_frame.Http_header.http_header ->
Http_headers.name -> string -> Http_frame.Http_header.http_header
end
module Http_error :
sig
exception Http_exception of int * string option
val expl_of_code : int -> string
val display_http_exception : exn -> unit
val string_of_http_exception : exn -> string
end
type t = {
header : Http_frame.Http_header.http_header;
content : string Ocsistream.t option;
}
end