{"id":13617087,"url":"https://github.com/mrkkrp/req","last_synced_at":"2025-05-14T20:09:40.120Z","repository":{"id":13028660,"uuid":"68138511","full_name":"mrkkrp/req","owner":"mrkkrp","description":"An HTTP client library","archived":false,"fork":false,"pushed_at":"2025-04-08T09:09:28.000Z","size":377,"stargazers_count":343,"open_issues_count":9,"forks_count":42,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-14T15:04:52.349Z","etag":null,"topics":["haskell","http-client"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrkkrp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2016-09-13T19:03:43.000Z","updated_at":"2025-05-09T10:31:07.000Z","dependencies_parsed_at":"2023-09-22T01:52:12.004Z","dependency_job_id":"e8eda49f-d780-4e5a-885a-1a71d3aa2c32","html_url":"https://github.com/mrkkrp/req","commit_stats":{"total_commits":299,"total_committers":30,"mean_commits":9.966666666666667,"dds":"0.46488294314381273","last_synced_commit":"4d6ae0764679110ffae4e875b9d2af7837b5e4dd"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkkrp%2Freq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkkrp%2Freq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkkrp%2Freq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkkrp%2Freq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrkkrp","download_url":"https://codeload.github.com/mrkkrp/req/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254219374,"owners_count":22034397,"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":["haskell","http-client"],"created_at":"2024-08-01T20:01:36.804Z","updated_at":"2025-05-14T20:09:40.092Z","avatar_url":"https://github.com/mrkkrp.png","language":"Haskell","funding_links":[],"categories":["Haskell","Programming Languages"],"sub_categories":["Haskell"],"readme":"# Req\n\n[![License BSD3](https://img.shields.io/badge/license-BSD3-brightgreen.svg)](http://opensource.org/licenses/BSD-3-Clause)\n[![Hackage](https://img.shields.io/hackage/v/req.svg?style=flat)](https://hackage.haskell.org/package/req)\n[![Stackage Nightly](http://stackage.org/package/req/badge/nightly)](http://stackage.org/nightly/package/req)\n[![Stackage LTS](http://stackage.org/package/req/badge/lts)](http://stackage.org/lts/package/req)\n[![CI](https://github.com/mrkkrp/req/actions/workflows/ci.yaml/badge.svg)](https://github.com/mrkkrp/req/actions/workflows/ci.yaml)\n\n* [Related packages](#related-packages)\n* [Blog posts](#blog-posts)\n* [Contribution](#contribution)\n* [License](#license)\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nmodule Main (main) where\n\nimport Control.Monad.IO.Class\nimport Data.Aeson\nimport Network.HTTP.Req\n\nmain :: IO ()\n-- You can either make your monad an instance of 'MonadHttp', or use\n-- 'runReq' in any IO-enabled monad without defining new instances.\nmain = runReq defaultHttpConfig $ do\n  let payload =\n        object\n          [ \"foo\" .= (10 :: Int),\n            \"bar\" .= (20 :: Int)\n          ]\n  -- One function—full power and flexibility, automatic retrying on timeouts\n  -- and such, automatic connection sharing.\n  r \u003c-\n    req\n      POST -- method\n      (https \"httpbin.org\" /: \"post\") -- safe by construction URL\n      (ReqBodyJson payload) -- use built-in options or add your own\n      jsonResponse -- specify how to interpret response\n      mempty -- query params, headers, explicit port number, etc.\n  liftIO $ print (responseBody r :: Value)\n```\n\nReq is an HTTP client library that attempts to be easy-to-use, type-safe,\nand expandable.\n\n“Easy-to-use” means that the library is designed to be beginner-friendly so\nit's simple to add to your monad stack, intuitive to work with,\nwell-documented, and does not get in your way. Doing HTTP requests is a\ncommon task and a Haskell library for this should be approachable and clear\nto beginners, thus certain compromises were made. For example, one cannot\ncurrently modify `ManagerSettings` of the default manager because the\nlibrary always uses the same implicit global manager for simplicity and\nmaximal connection sharing. There is a way to use your own manager with\ndifferent settings, but it requires more typing.\n\n“Type-safe” means that the library tries to eliminate certain classes of\nerrors. For example, we have correct-by-construction URLs; it is guaranteed\nthat the user does not send the request body when using methods like GET or\nOPTIONS, and the amount of implicit assumptions is minimized by making the\nuser specify their intentions in an explicit form. For example, it's not\npossible to avoid specifying the body or the method of a request.\nAuthentication methods that assume HTTPS force the user to use HTTPS at the\ntype level.\n\n“Expandable” refers to the ability to create new components without having\nto resort to hacking. For example, it's possible to define your own HTTP\nmethods, create new ways to construct the body of a request, create new\nauthorization options, perform a request in a different way, and create your\nown methods to parse a response.\n\nThe library uses the following mature packages under the hood to guarantee\nyou the best experience:\n\n* [`http-client`](https://hackage.haskell.org/package/http-client)—low level\n  HTTP client used everywhere in Haskell.\n* [`http-client-tls`](https://hackage.haskell.org/package/http-client-tls)—TLS\n  (HTTPS) support for `http-client`.\n\nIt is important to note that since we leverage well-known libraries that the\nwhole Haskell ecosystem uses, there is no risk in using Req. The machinery\nfor performing requests is the same as with `http-conduit` and Wreq. The\nonly difference is the API.\n\n## Related packages\n\nThe following packages are designed to be used with Req:\n\n* [`req-conduit`](https://hackage.haskell.org/package/req-conduit)—support\n  for streaming request and response bodies in constant memory.\n\nIf you happen to have written a package that adds new features to Req,\nplease submit a PR to include it in this list.\n\n## Blog posts\n\n* [Req 1.0.0, HTTP client, and streaming](https://markkarpov.com/post/req-1.0.0-http-client-and-streaming.html)\n\n## Contribution\n\nIssues, bugs, and questions may be reported in [the GitHub issue tracker for\nthis project](https://github.com/mrkkrp/req/issues).\n\nPull requests are also welcome.\n\n## License\n\nCopyright © 2016–present Mark Karpov\n\nDistributed under BSD 3 clause license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkkrp%2Freq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrkkrp%2Freq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkkrp%2Freq/lists"}