On Tue, Apr 4, 2017 at 2:22 AM Sébastien Hinderer <Sebastien.Hinderer@inria.fr> wrote:
Dear all,

Is there a recommended OCaml library that can be used for interacting
with REST APIs?

It should work over http as well as https.


If you're asking for client access then there are a few options.  One is to the the ocurl bindings to libcurl:

http://opam.ocaml.org/packages/ocurl/

ocurl is very flexible and requires some extra steps in your code to form the exact request desired.  In return you get a lot of flexibility in how all aspects of the request are handled.  You can use it from standard sequential OCaml, with OCaml's own threads or cooperatively with Lwt.

Another option is to use one of the cohttp client modules:

http://opam.ocaml.org/packages/cohttp/

cohttp currently works with Lwt, Async, mirage or compiled to javascript.  It's quite straightforward to use, though the documentation can take some effort to dig through.  cohttp also has the benefit of being pure OCaml, including HTTPS support if you compile with ocaml-tls.

I hope this helps you get started,

Hez