caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] REST APIs
@ 2017-04-04  8:22 Sébastien Hinderer
  2017-04-04 13:46 ` Francois BERENGER
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sébastien Hinderer @ 2017-04-04  8:22 UTC (permalink / raw)
  To: caml-list

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.

Thanks,

Sébastien.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] REST APIs
  2017-04-04  8:22 [Caml-list] REST APIs Sébastien Hinderer
@ 2017-04-04 13:46 ` Francois BERENGER
  2017-04-04 15:02 ` Hezekiah M. Carty
  2017-04-04 21:28 ` John McAlpine
  2 siblings, 0 replies; 4+ messages in thread
From: Francois BERENGER @ 2017-04-04 13:46 UTC (permalink / raw)
  To: caml-list

On 04/04/2017 03:22 AM, Sébastien Hinderer wrote:
> Dear all,
>
> Is there a recommended OCaml library that can be used for interacting
> with REST APIs?

opam mentions ocaml-webmachine:

https://github.com/inhabitedtype/ocaml-webmachine

I'm unsure if it's OK for https however.

> It should work over http as well as https.
>
> Thanks,
>
> Sébastien.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] REST APIs
  2017-04-04  8:22 [Caml-list] REST APIs Sébastien Hinderer
  2017-04-04 13:46 ` Francois BERENGER
@ 2017-04-04 15:02 ` Hezekiah M. Carty
  2017-04-04 21:28 ` John McAlpine
  2 siblings, 0 replies; 4+ messages in thread
From: Hezekiah M. Carty @ 2017-04-04 15:02 UTC (permalink / raw)
  To: Sébastien Hinderer, caml-list

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] REST APIs
  2017-04-04  8:22 [Caml-list] REST APIs Sébastien Hinderer
  2017-04-04 13:46 ` Francois BERENGER
  2017-04-04 15:02 ` Hezekiah M. Carty
@ 2017-04-04 21:28 ` John McAlpine
  2 siblings, 0 replies; 4+ messages in thread
From: John McAlpine @ 2017-04-04 21:28 UTC (permalink / raw)
  To: Sébastien Hinderer, caml-list

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

I'm making a PPX Deriving plugin for this exact purpose! It's called
ppx_netblob and I have a blog post outlining its use here:
https://medium.com/@cb04cf16ac8a/a48f970c9af8 (sending from my phone, so I
can't explain much more about it). I'd love to work with you to help
improve it, since at the moment it's pretty much just suited for a couple
of my personal projects.

It can use both http and https as long as your cohttp installation can use
them both

On Apr 4, 2017 02:23, "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.
>
> Thanks,
>
> Sébastien.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-04 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  8:22 [Caml-list] REST APIs Sébastien Hinderer
2017-04-04 13:46 ` Francois BERENGER
2017-04-04 15:02 ` Hezekiah M. Carty
2017-04-04 21:28 ` John McAlpine

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).