http-cookie

HTTP cookie library for OCaml
README

A comprehensive and standards compliant HTTP cookies library for ocaml.

HTTP cookies are serialized as follows:

  • In a Cookie header in a HTTP request

  • In a Set-Cookie header in a HTTP response.

The library supports consuming and creating HTTP cookies in both requests
and responses.

The standard implemented by the library is RFC 6265.

API Documentation

Installation

$ opam install http-cookie

Usage

Create a cookie,

Http_cookie.create "SID" "23432324"

Serialize cookie to a HTTP Set-Cookie header value,

let s = Http_cookie.to_set_cookie_header_value c in
s = "SID=31d4d96e407aad42; Path=/; Secure; HttpOnly; Expires=Sun, 06 Nov 1994 08:49:37 GMT"
Install
Published
28 Nov 2020
Maintainers
Sources
http-cookie-v2.0.0.tbz
sha256=e64d180d358435357f902ecc6b583f8f16e104639285ef598240ed386461fb31
sha512=399ce242432553f24925137ac0b4cf5ba7f5ef3f756e0ba3b059233e52116f6738a625479f038b63b5646f1aa0b99b13a5894a49e52e08c94ee41fb541870e90
Dependencies
odoc
with-doc
ocaml
>= "4.10.0"
dune
>= "2.7"
Reverse Dependencies