The flexible HTTP client library for Elixir, with middleware and multiple adapters
open sourceMITfree
Tesla is an HTTP client library for Elixir built around a middleware stack: you build an API client by composing middleware for base URLs, headers, JSON encoding, authentication, logging, retries and more, over a common interface. The HTTP adapter underneath is swappable (Mint, Finch, Hackney and others), so the same client code runs on whichever one an application uses. It was inspired by Ruby's Faraday.
Problems it solves
- build an API client in Elixir with retries, logging and auth as middleware
- switch the HTTP adapter in my Elixir app without rewriting request code
- an HTTP client for Elixir like Ruby's Faraday
- add JSON encoding and base URLs to every request from one client module
Features
- composable middleware stack
- swappable adapters: Mint, Finch, Hackney and others
- middleware for JSON, auth, logging and retries
Capabilities
| Takes plugins | plan not known |
|---|
Alternatives
The same job
These do what Tesla does.
- HTTPoison Yet another HTTP client for Elixir, powered by hackney
