package http-date

Build not checked
  1. Overview
  2. Docs
HTTP Datetime encoder/decoder

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1.tar.gz
md5=2a702c7c59140cfa7d38a217931a5ca6
sha512=c9bd4cfe2df52f778d539cb6627e8bf027c8276abd0b8255c821f3b75dcd2215478960ed5a7c3cf0da2e74a9eb9de10cd95057ede33abbcc05702603e5a1e570

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 d = Http_date.decode "Sun, 06 Nov 1994 08:49:37 GMT";;
val d : Ptime.t = <abstr>

# Ptime.to_date_time d ;;
- : Ptime.date * Ptime.time = ((1994, 11, 6), ((8, 49, 37), 0))

# Http_date.encode d ;;
- : 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 (4)

  1. menhir >= "20220210"
  2. ptime >= "1.1.0"
  3. dune >= "3.6"
  4. ocaml >= "4.08.0"

Dev Dependencies (2)

  1. odoc with-doc
  2. mdx >= "2.1.0" & with-test

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building http-date with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. 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.

This version is not in the latest run; the versions below are.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2 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