package mechaml
Library
Module
Module type
Parameter
Class
Class type
Cookies management
Cookiejar is the module that stores and manages cookies. A Cookiejar stores the list of all cookies created by the Set-Cookie
headers sent by the server. It is able to automatically extract cookies from server headers (see add_from_headers
), or to select and add relevant coookies to the Cookie
client header before a request (see add_to_headers
).
It is mainly used by the Agent
module internally, but can be manipulated if one needs to edit manually the cookies sent by the agent.
module Cookie : sig ... end
Representation of a cookie
val empty : t
The emtpy cookie jar
val add_from_headers : Uri.t -> Cohttp.Header.t -> t -> t
Given a header received from a server, update the jar according to possible Set-Cookie
HTTP header
val add_to_headers : Uri.t -> Cohttp.Header.t -> t -> Cohttp.Header.t
Given an URI to request, update the client HTTP headers with relevant cookies before sending it to the server
val is_empty : t -> bool