https://github.com/drowzy/http_co
https://github.com/drowzy/http_co
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/drowzy/http_co
- Owner: drowzy
- Created: 2021-03-19T20:01:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-24T12:15:15.000Z (almost 5 years ago)
- Last Synced: 2025-02-16T11:14:08.295Z (over 1 year ago)
- Language: Elixir
- Size: 34.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTPCo
---

A composable HTTP client library for Elixir
```elixir
"http://httpbin.org"
|> HTTPCo.get()
|> HTTPCo.Request.set_header({"Accept", "application/json"})
|> HTTPCo.Request.query_param({"key", "value"})
|> HTTPCo.run()
|> HTTPCo.Response.map_ok(&:erlang.iolist_to_binary/1)
|> HTTPCo.Response.map_ok(&Jason.decode/1)
|> HTTPCo.Response.map_err(&Error.handler/1)
|> HTTPCo.Response.into_response()
```
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `http_co` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:http_co, "~> 0.1.0"}
]
end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/http_co](https://hexdocs.pm/http_co).