module Ocsigen_http_frame: sig .. end
This table is to store cookie values for each path. The key has type url_path option: it is for the path (default: root of the site),
type etag = string
type url_path = string list
module Cookies: Map.S with type key = url_path
This table is to store cookie values for each path.
module Cookievalues: Map.S with type key = string
This table is to store one cookie value for each cookie name.
type cookie = | | OSet of float option * string |
| | OUnset |
Type used for cookies to set. The float option is the timestamp for the expiration date. The string is the value.
type cookieset = cookie Cookievalues.t
Cookies.t
val add_cookie : url_path ->
string ->
cookie ->
cookieset -> cookieset
add_cookie c cookie_table adds the cookie c to the table cookie_table. If the cookie is already bound, the previous binding disappear.
val add_cookies : cookie Cookievalues.t
Cookies.t ->
cookie Cookievalues.t
Cookies.t ->
cookie Cookievalues.t
Cookies.t
add_cookies newcookies oldcookies adds the cookies from newcookies to oldcookies. If cookies are already bound in oldcookies, the previous binding disappear.
val compute_new_ri_cookies : float ->
string list ->
string Cookievalues.t ->
cookie Cookievalues.t
Cookies.t -> string Cookievalues.t
compute_new_ri_cookies now path ri_cookies cookies_to_set adds the cookies from cookies_to_set to ri_cookies, as if the cookies add been send to the browser and the browser was doing a new request to the url path. Only the cookies that match path (current path) are added.
type result = { | res_cookies : cookieset; |
| res_lastmodified : float option; |
| res_etag : 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; |
}
The type of answers to send
val default_result : unit -> result
Default result to use as a base for constructing others.
val empty_result : unit -> result
result for an empty page.
module type HTTP_CONTENT = sig .. end
module Http_header: sig .. end
module Http_error: sig .. end
type t = {}
The type of HTTP frames. The content may be void (no body) or a stream. While sending, a stream will be sent with chunked encoding if no content-length is supplied. abort is the function to be called if you want to cancel the stream reading (closes the connection).