An HTTP client for Elixir based on ibrowse, continuing the HTTPun tradition of HTTParty and HTTPie.
HTTPotion is an HTTP client library for the Elixir programming language, built on top of the ibrowse Erlang HTTP client. It provides a simple and expressive API for making HTTP requests, handling responses, and building HTTP API wrappers with metaprogramming capabilities. It aims to make HTTP interactions in Elixir both fun and practical through a clean, extensible design.
Elixir developers who need a straightforward, feature-rich HTTP client for tasks like consuming APIs, building API wrappers, or handling HTTP requests with specific needs like asynchronous streaming or direct ibrowse worker access.
Developers choose HTTPotion for its expressive API that simplifies common HTTP tasks, its extensibility via metaprogramming hooks for creating custom API wrappers, and its unique features like case-insensitive header access and direct integration with ibrowse for persistent connections.
[Deprecated because ibrowse is not maintained] HTTP client for Elixir (use Tesla please)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
HTTPotion offers a clean, intuitive syntax for common HTTP tasks, as shown with simple calls like `HTTPotion.get "https://httpbin.org/get"` and support for options like query maps and basic auth.
By extending `HTTPotion.Base`, developers can create custom API wrappers with hooks for URL, header, and body processing, enabling elegant abstractions like the GitHub example in the README.
Response headers are wrapped in a struct allowing access via atoms or strings regardless of capitalization, simplifying header handling when servers use varying cases.
Supports streaming responses to Elixir processes with messages like `AsyncChunk` and `AsyncEnd`, useful for real-time data processing or handling large downloads efficiently.
Includes typespecs compatible with Dialyzer and Elixir LS, aiding in static analysis and improving code reliability, as noted in the README's type analysis section.
The README explicitly warns that ibrowse is 'a bit buggy and not super actively maintained,' which can lead to reliability issues and lack of fixes for critical bugs in production.
Compared to newer clients like Tesla, HTTPotion lacks features such as HTTP/2 support or built-in middleware, and the README even suggests alternatives for better stability.
While enabled by default, certificate verification relies on system CA bundles or the optional certifi package, adding setup steps and potential environment-specific issues.