{"id":13741205,"url":"https://github.com/gleam-lang/httpc","last_synced_at":"2025-06-11T00:37:47.738Z","repository":{"id":42485336,"uuid":"235399341","full_name":"gleam-lang/httpc","owner":"gleam-lang","description":"📡 Make requests to HTTP servers with httpc","archived":false,"fork":false,"pushed_at":"2025-05-14T09:59:33.000Z","size":59,"stargazers_count":128,"open_issues_count":8,"forks_count":19,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-09T03:29:48.624Z","etag":null,"topics":["erlang","gleam","http-client"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/gleam_httpc/","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gleam-lang.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},"funding":{"github":["lpil","giacomocavalieri"],"liberapay":"gleam"}},"created_at":"2020-01-21T17:21:45.000Z","updated_at":"2025-06-06T13:07:30.000Z","dependencies_parsed_at":"2022-09-18T17:23:05.524Z","dependency_job_id":"e8256f39-5fb6-4b28-9498-55d8d902364c","html_url":"https://github.com/gleam-lang/httpc","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleam-lang%2Fhttpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleam-lang%2Fhttpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleam-lang%2Fhttpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleam-lang%2Fhttpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gleam-lang","download_url":"https://codeload.github.com/gleam-lang/httpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleam-lang%2Fhttpc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259177182,"owners_count":22817327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["erlang","gleam","http-client"],"created_at":"2024-08-03T04:00:56.735Z","updated_at":"2025-06-11T00:37:47.690Z","avatar_url":"https://github.com/gleam-lang.png","language":"Gleam","funding_links":["https://github.com/sponsors/lpil","https://github.com/sponsors/giacomocavalieri","https://liberapay.com/gleam"],"categories":["Packages","Gleam"],"sub_categories":["HTTP Clients"],"readme":"# httpc\n\u003ca href=\"https://github.com/gleam-lang/httpc/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/gleam-lang/httpc\" alt=\"GitHub release\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/Fm8Pwmy\"\u003e\u003cimg src=\"https://img.shields.io/discord/768594524158427167?color=blue\" alt=\"Discord chat\"\u003e\u003c/a\u003e\n![CI](https://github.com/gleam-lang/httpc/workflows/test/badge.svg?branch=main)\n\nBindings to Erlang's built in HTTP client, `httpc`.\n\n```shell\ngleam add gleam_httpc@4\n```\n```gleam\nimport gleam/http/request\nimport gleam/http/response\nimport gleam/httpc\nimport gleam/result\nimport gleeunit/should\n\npub fn send_request() {\n  // Prepare a HTTP request record\n  let assert Ok(base_req) =\n    request.to(\"https://test-api.service.hmrc.gov.uk/hello/world\")\n\n  let req =\n    request.prepend_header(base_req, \"accept\", \"application/vnd.hmrc.1.0+json\")\n\n  // Send the HTTP request to the server\n  use resp \u003c- result.try(httpc.send(req))\n\n  // We get a response record back\n  resp.status\n  |\u003e should.equal(200)\n\n  resp\n  |\u003e response.get_header(\"content-type\")\n  |\u003e should.equal(Ok(\"application/json\"))\n\n  resp.body\n  |\u003e should.equal(\"{\\\"message\\\":\\\"Hello World\\\"}\")\n\n  Ok(resp)\n}\n```\n\n## Use with Erlang/OTP versions older than 26.0\n\nOlder versions of HTTPC do not verify TLS connections by default, so with them\nyour connection may not be secure when using this library. Consider upgrading to\na newer version of Erlang/OTP, or using a different HTTP client such as\n[hackney](https://github.com/gleam-lang/hackney).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgleam-lang%2Fhttpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgleam-lang%2Fhttpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgleam-lang%2Fhttpc/lists"}