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

Description

Published: 01 Feb 2023

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.03.0"
  4. dune >= "2.7"

Dev Dependencies (3)

  1. odoc with-doc
  2. cohttp-lwt-unix with-test
  3. alcotest with-test

Used by (3)

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

Conflicts

None