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.3.0.tbz
sha256=427fcf28134e70cb77764d9feee243f31d32a38447a1b5d28d341c93b7dc5d3c
sha512=a8313c902f96a352fb5f592b0b4d2dbd72efcd92a688c812350be5561442d418b64ab0325e2ffe181385268224dc51a66107451a11b59e45a50e38827b9a9912

README.md.html

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.