package http-date

All checked builds pass
  1. Overview
  2. Docs
HTTP Datetime encoder/decoder

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.2.tar.gz
md5=c05dd250cd2bcef94b9dedc0fda6202d
sha512=00cf1c4c6ca9dd95042707fb9b815bdd30532f3d0830a846bbbc46e6fc064a7565484241d8f8c2f517c9b1184492eeb2b8ff3efa6831cfe42e6c00fc69b3e162

Description

RFC 9110 compliant HTTP datetime decoder and encoder

Added to opam-repository:

README

HTTP Date

HTTP timestamp decoders and encoders complaint to RFC 9110 (HTTP Semantics). It is designed to be used with HTTP Date header field.

The current supported formats for decoding/encoding are as follows:

  • IMF(Internet Message Format) date, eg Sun, 06 Nov 1994 08:49:37 GMT
  • RFC 850 date, eg Sunday, 06-Nov-94 08:49:37 GMT
  • asctime date, eg Sun Nov 6 08:49:37 1994

API usage:

  • Decoding and encoding IMF fixdate formatted timestamp values:
# let imf_fixdate = Http_date.decode "Sun, 06 Nov 1994 08:49:37 GMT";;
val imf_fixdate : Http_date.t = `IMF (`Sun, (1994, 11, 6), (8, 49, 37))

# Http_date.encode imf_fixdate;;
- : string = "Sun, 06 Nov 1994 08:49:37 GMT"

References:

Installation

opam install http-date

Using in Dune

Specify the dependency in dune executable or library stanza as follows:

  • executable
(executable
  (name hello)
  (libraries http-date))
  • library
 (library
   (name hello)
   (libraries http-date))

Dependencies (2)

  1. dune >= "3.22"
  2. ocaml >= "4.11.0"

Dev Dependencies (3)

  1. odoc with-doc
  2. mdx >= "2.1.0" & with-test
  3. alcobar < "0.3.2" & with-test

Optional Dependencies

None

Used by (1)

  1. verdict

Conflicts

None

Build status

Results of building http-date with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure