Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they work with HTTP…
HTTP client libraries
- http://erlang.org/doc/man/httpc.html - erlang (part of OTP)
- https://github.com/benoitc/hackney - erlang, socket pools
- https://github.com/cmullaparthi/ibrowse - erlang, pool/pipeline per destination
- https://github.com/puzza007/katipo - erlang, libcurl
- https://github.com/ninenines/gun - erlang, HTTP/2, Websocket, keeping connection with supervisor
- https://github.com/inaka/shotgun - erlang, on the top of gun, out-of-box support of Server-sent Events
HTTP Client Wrappers
- https://github.com/teamon/tesla - elixir, support httpc, hackney, ibrowse
- https://github.com/edgurgel/httpoison - elixir, hackney
- https://github.com/myfreeweb/httpotion - elixir, ibrowse
- https://github.com/alexandrubagu/simplehttp - elixir, httpc
- HTTP client libraries - need better one in standard library?
- Erlang httpc or Elixir third-party http libraries (httpoison, httppotion)?
Thoughts & Questions
- Although HTTP spec says headers are case-insensitive, http client libraries should not automatically downcase such values (especially for outgoing request) since there are applications require specific cases
- headers, form data, and query string should be a list not a map to preserve orders (both order of keys and order of values)
- For performance, what about using NIF to parse headers? For example, puma (app server in Ruby) uses C for this: https://github.com/puma/puma/tree/v3.12.0/ext/puma_http11 - such parser may be shared across client/server.
- How should HTTP libraries handle HTTP version upgrade?
- Should HTTP libraries make pure functional (zero side effect) or leverage more global states (connection pools, keeping connection, etc.)?
- For example, Tesla allows creating new client on the fly, so that it “builds” client without any configuration from “global” config; however as it may use HTTP client library (application) which maintains some state in it.