From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 3FC6E80113 for ; Tue, 4 Apr 2017 17:02:29 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=hez@0ok.org; spf=None smtp.mailfrom=hez@0ok.org; spf=None smtp.helo=postmaster@homiemail-a120.g.dreamhost.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hez@0ok.org) identity=pra; client-ip=208.113.200.129; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hez@0ok.org"; x-sender="hez@0ok.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hez@0ok.org) identity=mailfrom; client-ip=208.113.200.129; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hez@0ok.org"; x-sender="hez@0ok.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@homiemail-a120.g.dreamhost.com) identity=helo; client-ip=208.113.200.129; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hez@0ok.org"; x-sender="postmaster@homiemail-a120.g.dreamhost.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AjfSxhhwoX16kr83XCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?2uwVIJqq85mqBkHD//Il1AaPBtSHraocw8Pt8InYEVQa5piAtH1QOLdtbDQizf?= =?us-ascii?q?ssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1?= =?us-ascii?q?JuPoEYLOksi7ze6/9pncbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeu?= =?us-ascii?q?BWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbO?= =?us-ascii?q?SxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiS?= =?us-ascii?q?cIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CSmVBUMReWSxPDI2/?= =?us-ascii?q?coUBEfYOMP1CoIXhvVYDtweyCRWuCe7p1zRGhmX23ao/0+k5Hw3I3hIvHtMQv3?= =?us-ascii?q?TXrdX6LqcSWv2ywqXS0D7OcelZ2S3h6InIfBwqvPaBXbJufsvQ0kQjCwTFjlaK?= =?us-ascii?q?pYziJTOV2f0Avm6G5ORuUuKvjnQoqwB3ojW3wccjlpPGhocRylze8iV52ok1Kc?= =?us-ascii?q?W5SE51Yd+kF4ZQtzuEOIRsWcMiQGBouCA1yr0Ivp67ZjQFyJAmxxHBbfyHb5KH?= =?us-ascii?q?7Q7/W+mPOjd4n25leLKhiBa07UigyvPzVtOq31lQtCpKjMPDtn4T2B3d7ciHUu?= =?us-ascii?q?d9/kam2TaJzADf8OZEIUYqmqfdNpUvwaYwm4INvUjfHSL6glj6gLKYe0k+5OSk?= =?us-ascii?q?9/jrbq/7qpOCM4J4kh/yPrgql8ClAuk1MhICU3aG9em9zrHv4E70TKtMg/YriK?= =?us-ascii?q?fWqoraKt4epqOhAw9azIIj6xGnAjem19QYmHgHI0xAeB2djojpP0jCL+rlAfuh?= =?us-ascii?q?n1igijhry+rbMb37HJrCNH3DkLfmfbZm905Q0hY8zdda555MC7EBJuz8WlPpud?= =?us-ascii?q?DGEhM0MBa4z/v6BNhzzI8SR36DDrODPK/Pr1OF4vojI+yWa48UvDb9JeIl5/nr?= =?us-ascii?q?jXIhmV8SY6io0IALZHC/HfRqOUKZYWDjgtsZC2cFohI+TPD2iF2FSTNce2y9X6?= =?us-ascii?q?c45j0iDIKmDJzDRpy2jbya3Ca7G4VWaXpcBlCNF3fobYSEVO0WZCKcOM8y2gAD?= =?us-ascii?q?AIMgQYY6yRCjsjjayrxrI/DZ4GVMjp/p3cNp5uDV0zEz8zB5FcmH+2CLVWB92G?= =?us-ascii?q?0SEXt+16l6pQl5y0yf+al+mf1RU9JJtN1TVQJvf77R3eF5CtnyEieHNvyAUkq3?= =?us-ascii?q?CJ3yATwjZoo2wJkJeUkrSIbqtQzKwyf/W+xdrLeMHpFht/uEh3U=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D+AgDktONYh4HIcdBcHQEFAQsBGAEFA?= =?us-ascii?q?QsBhAqBC4NjY4oijzwBAQaBI5dhJoV8AoQBFQEBAQEBAQEBAQEBEgEBAQgNCQg?= =?us-ascii?q?oL4IzIgGCQAECAgEjHToECwsEBzcCAiISAQUBHAYBEooBBQgOoS4/jAOCJoMPh?= =?us-ascii?q?0wBAQEHAQEBAQEBARkIhgmFNIcgDC6CX5xyAYZ8i1OCUo5qki0zgRUPJoEnaAh?= =?us-ascii?q?BGAaETIFvdYkbAQEB?= X-IPAS-Result: =?us-ascii?q?A0D+AgDktONYh4HIcdBcHQEFAQsBGAEFAQsBhAqBC4NjY4o?= =?us-ascii?q?ijzwBAQaBI5dhJoV8AoQBFQEBAQEBAQEBAQEBEgEBAQgNCQgoL4IzIgGCQAECA?= =?us-ascii?q?gEjHToECwsEBzcCAiISAQUBHAYBEooBBQgOoS4/jAOCJoMPh0wBAQEHAQEBAQE?= =?us-ascii?q?BARkIhgmFNIcgDC6CX5xyAYZ8i1OCUo5qki0zgRUPJoEnaAhBGAaETIFvdYkbA?= =?us-ascii?q?QEB?= X-IronPort-AV: E=Sophos;i="5.36,275,1486422000"; d="scan'208,217";a="219201662" Received: from sub5.mail.dreamhost.com (HELO homiemail-a120.g.dreamhost.com) ([208.113.200.129]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Apr 2017 17:02:27 +0200 Received: from homiemail-a120.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a120.g.dreamhost.com (Postfix) with ESMTP id 5E2E760001001 for ; Tue, 4 Apr 2017 08:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=0ok.org; h=mime-version :references:in-reply-to:from:date:message-id:subject:to :content-type; s=0ok.org; bh=j1Hu3CXbsUhgD9hu2bCLzbqYi2w=; b=gZw phGTx91JGzFwnf/YlNMbTWUYl85Jr59LNn/sqtSerytcw8BwO3i79WQ1ByMDRxy7 VC6f+u1Jf19IqfeMRN6HiLFNZ6uQDkf5is8wIIvdAHcmDA56gtOePxE6Nq8xiqhP qVY1gLKDR0ODsMYmjOnH05TGghVqtodJBHOEzbLo= Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: hez@0ok.org) by homiemail-a120.g.dreamhost.com (Postfix) with ESMTPSA id 466E660001000 for ; Tue, 4 Apr 2017 08:02:24 -0700 (PDT) Received: by mail-qt0-f182.google.com with SMTP id n21so141101858qta.1 for ; Tue, 04 Apr 2017 08:02:24 -0700 (PDT) X-Gm-Message-State: AFeK/H1WgqgSxw0dSHNTjns1iAPM6Q3McA4uqA3zH8gERpUWw+UC0E79DcvonHmL85LPfLWEJGj7Jf1lEL9JPA== X-Received: by 10.200.50.20 with SMTP id x20mr23583408qta.169.1491318143367; Tue, 04 Apr 2017 08:02:23 -0700 (PDT) MIME-Version: 1.0 References: <20170404082246.gco2rykoz7tvdrgw@pl-59055.rocqadm.inria.fr> In-Reply-To: <20170404082246.gco2rykoz7tvdrgw@pl-59055.rocqadm.inria.fr> From: "Hezekiah M. Carty" Date: Tue, 04 Apr 2017 15:02:12 +0000 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?S=C3=A9bastien_Hinderer?= , caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a113785442ed43d054c589075 Subject: Re: [Caml-list] REST APIs --001a113785442ed43d054c589075 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Apr 4, 2017 at 2:22 AM S=C3=A9bastien 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 --001a113785442ed43d054c589075 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Apr 4,= 2017 at 2:22 AM S=C3=A9bastien 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 aski= ng for client access then there are a few options.=C2=A0 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.=C2=A0 In return you get a = lot of flexibility in how all aspects of the request are handled.=C2=A0 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:




--001a113785442ed43d054c589075--