[ANN] HTTP client library

Hello,

we just released to the opam-repository the http-lwt-client package, which consists of both a library doing HTTP requests and a binary (hurl) that does HTTP requests.

The code is based on HTTP/AF and H2, and uses tls for HTTPS connections. Both HTTP/1(.1) and HTTP/2 protocols are supported. The motivation behind this package is to have a http client that has a reasonably small dependency cone, is purely implemented in OCaml, and uses the asynchronous task library lwt.

This package uses happy-eyeballs to connect to a remote host via IPv4 and IPv6, as proposed by IETF RFC 8305: on any computer with either IPv4 or IPv6 connectivity, a remote IPv6 or IPv4 server will be connected. Preference is given to IPv6.

If a https url is provided, the server certificate is verified using the ca-certs package.

If you experience any issues or have further needs for this package, please report an issue on the GitHub issue tracker.

The installation is just an opam install http-lwt-client away :slight_smile:

15 Likes

Interesting, how does it compare to piaf?

the dependency cone is smaller (or different, http-lwt-client does not depend on gluten, nor on uri); http-lwt-client uses the purely OCaml tls stack (not OpenSSL). Also,http-lwt-client supports IPv6.

2 Likes

a dependency fails to build here on linux devuan beowulf + musl: https://github.com/roburio/http-lwt-client/issues/4

Thanks - unfortunately that is not something we can fix in http-lwt-client, but should be reported and fixed in zarith.

1 Like

now 0.0.2 is released that unifies the response type and API (previously it was a variant and clients had to write code for both HTTP1 and HTTP2). Now, a single record and Status/Headers/Version module aliases are provided (very close to HTTP/AF). Enjoy.

6 Likes