{"id":16613192,"url":"https://github.com/c-cube/ezcurl","last_synced_at":"2026-01-21T03:10:55.737Z","repository":{"id":46705118,"uuid":"208361801","full_name":"c-cube/ezcurl","owner":"c-cube","description":"A simple wrapper around OCurl.","archived":false,"fork":false,"pushed_at":"2026-01-20T03:27:22.000Z","size":748,"stargazers_count":30,"open_issues_count":5,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-20T10:21:40.204Z","etag":null,"topics":["curl","easy","http","http-get-it-while-it-s-hot","lwt","ocaml","ocurl"],"latest_commit_sha":null,"homepage":"https://c-cube.github.io/ezcurl/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c-cube.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-13T23:22:24.000Z","updated_at":"2026-01-20T03:27:26.000Z","dependencies_parsed_at":"2023-11-25T06:20:10.026Z","dependency_job_id":"7c53c595-593a-4475-b990-28fe00ce434b","html_url":"https://github.com/c-cube/ezcurl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/c-cube/ezcurl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fezcurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fezcurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fezcurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fezcurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c-cube","download_url":"https://codeload.github.com/c-cube/ezcurl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fezcurl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28624349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T02:47:06.670Z","status":"ssl_error","status_checked_at":"2026-01-21T02:45:44.886Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curl","easy","http","http-get-it-while-it-s-hot","lwt","ocaml","ocurl"],"created_at":"2024-10-12T01:46:24.533Z","updated_at":"2026-01-21T03:10:55.732Z","avatar_url":"https://github.com/c-cube.png","language":"OCaml","readme":"# EZCurl [![build](https://github.com/c-cube/ezcurl/actions/workflows/main.yml/badge.svg)](https://github.com/c-cube/ezcurl/actions/workflows/main.yml)\n\nA simple wrapper around [OCurl](https://github.com/ygrek/ocurl/), for easy tasks around http.\n\n**project goals**\n\n- be as simple to use as possible.\n- be as reliable as possible (work is done by cURL and the ocurl bindings anyway).\n- stable API with few dependencies, so that user code compiles without breakage\n  for a long time.\n\n## Installation\n\n- for the synchronous library: `opam install ezcurl`\n- for the lwt-based library: `opam install ezcurl-lwt` (depends on `ezcurl`)\n\n## Usage\n\nA small web crawler can be found in `examples/argiope`. It's very incomplete\nand naive but demonstrates basic usage of `Ezcurl_lwt.get`.\n\n### Synchronous API\n\nThe library lives in a module `Ezcurl`, which wraps `Curl.t` with functions\nsuch as `get` that combine many different low level API calls into one.\nIt also follows redirections by default, and returns a `Ezcurl.response`\nobject that contains the body, headers, and error code.\n\n```ocaml\n# #require \"ezcurl\";;\n# let url = \"https://curl.haxx.se/\";;\nval url : string = \"https://curl.haxx.se/\"\n# let res = Ezcurl.get ~url ();;\n...\n# let content = match res with Ok c -\u003e c | Error (_,s) -\u003e failwith s;;\nval content : string Ezcurl_core.response =\n...\n\n# content.Ezcurl.code;;\n- : int = 200\n```\n\nIt is also possible to create a client with `Ezcurl.make()` and re-use\nit across calls with the optional parameter `client`.\n\n### Lwt API\n\nUsing `ezcurl-lwt`, a module `Ezcurl_lwt` becomes available, with\nfunctions that are similar to the ones in `Ezcurl` but are non blocking.\nThis makes it easy to run several queries in parallel:\n\n```ocaml\n# #require \"ezcurl-lwt\";;\n# let urls = [\n  \"https://en.wikipedia.org/wiki/CURL\";\n  \"https://en.wikipedia.org/wiki/OCaml\";\n  \"https://curl.haxx.se/\";\n  ];;\nval urls : string list =\n  [\"https://en.wikipedia.org/wiki/CURL\";\n   \"https://en.wikipedia.org/wiki/OCaml\"; \"https://curl.haxx.se/\"]\n\n# open Lwt.Infix;;\n# let codes =\n    List.map (fun url -\u003e Ezcurl_lwt.get ~url ()) urls\n    |\u003e Lwt_list.map_p\n    (fun fut -\u003e\n      fut \u003e\u003e= function\n      | Ok r -\u003e Lwt.return r.Ezcurl_lwt.code\n      | Error e -\u003e Lwt.fail (Failure \"oh no\"))\n  ;;\n...\n# codes;;\n- : int list = [200; 200; 200]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-cube%2Fezcurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc-cube%2Fezcurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-cube%2Fezcurl/lists"}