package curly

  1. Overview
  2. Docs
Curly is a brain dead wrapper around the curl command line utility

Install

Dune Dependency

Authors

Maintainers

Sources

curly-0.2.0.tbz
sha256=d350f5fb4dc2ab12eb3e805b356a5228ecc00497fadc38502c0d6445676e781f
sha512=ae5a704e6849d60739203f7704ae0fb62408f171cfc910db5f2bfa62ae4be13edcec938387ee6a3680eebe3442c08b08b024fd4d65dbcb5bacb040cf43c69468

Description

Published: 09 Sep 2020

README

Curly - The Dumbest Http Client

Curly is a brain dead wrapper around the curl command line utility designed to provide a 0 dependency solution for applications that want to create some very simple HTTP requests. It is not blazing fast, or async, but at least it involves no C bindings, it's trivial to vendor, and the API can be learned in 5 minutes.

Here's a simple example:


match Curly.(run (Request.make ~url:"https://opam.ocaml.org" ~meth:`GET ())) with
| Ok x ->
  Format.printf "status: %d\n" x.Curly.Response.code;
  Format.printf "headers: %a\n" Curly.Header.pp x.Curly.Response.headers;
  Format.printf "body: %s\n" x.Curly.Response.body
| Error e ->
  Format.printf "Failed: %a" Curly.Error.pp e

There's not much more to it than this. Consult curly.mli to see how to construct various requests and read responses, or read the online documentation.

Dependencies (4)

  1. result
  2. base-unix
  3. ocaml >= "4.02.3"
  4. dune >= "2.4"

Dev Dependencies (3)

  1. odoc with-doc
  2. cohttp-lwt-unix with-test & != "3.0.0"
  3. alcotest with-test

Used by (3)

  1. calculon-web >= "0.5"
  2. dune-release >= "1.4.0" & < "2.0.0"
  3. opam-compiler >= "0.2.0"

Conflicts

None

OCaml

Innovation. Community. Security.