caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Hezekiah M. Carty" <hez@0ok.org>
To: "Sébastien Hinderer" <Sebastien.Hinderer@inria.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] REST APIs
Date: Tue, 04 Apr 2017 15:02:12 +0000	[thread overview]
Message-ID: <CAMfPyLD7N6EGO3LwYW9PZNMpw9Xhj+w+guA6E6R=ayk2wYZnTA@mail.gmail.com> (raw)
In-Reply-To: <20170404082246.gco2rykoz7tvdrgw@pl-59055.rocqadm.inria.fr>

[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1818 bytes --]

  parent reply	other threads:[~2017-04-04 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04  8:22 Sébastien Hinderer
2017-04-04 13:46 ` Francois BERENGER
2017-04-04 15:02 ` Hezekiah M. Carty [this message]
2017-04-04 21:28 ` John McAlpine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMfPyLD7N6EGO3LwYW9PZNMpw9Xhj+w+guA6E6R=ayk2wYZnTA@mail.gmail.com' \
    --to=hez@0ok.org \
    --cc=Sebastien.Hinderer@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).