Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. tesla

tesla

MITElixirv1.17.0

A flexible HTTP client library for Elixir with a composable middleware stack and support for multiple adapters.

GitHubGitHub
2.1k stars363 forks0 contributors

What is tesla?

Tesla is an HTTP client library for Elixir that leverages a composable middleware stack to streamline HTTP requests and responses. It provides a common interface for various HTTP adapters, simplifying HTTP communication by allowing developers to build custom API clients with reusable middleware components. The library solves the problem of building efficient, customizable HTTP clients with different architectural needs.

Target Audience

Elixir developers building API clients or applications requiring flexible HTTP communication, particularly those who need to swap HTTP adapters or create custom middleware pipelines. It's ideal for developers working on projects where HTTP client configuration and extensibility are important.

Value Proposition

Developers choose Tesla for its flexible and composable middleware architecture, inspired by Ruby's Faraday, which allows building tailored API clients with minimal effort. Its unique selling point is adapter agnosticism—decoupling HTTP logic from the underlying transport layer to support multiple adapters like Mint, Finch, and Hackney for performance and dependency flexibility.

Overview

The flexible HTTP client library for Elixir, with support for middleware and multiple adapters.

Use Cases

Best For

  • Building custom API clients with reusable middleware configurations in Elixir applications.
  • Swapping between HTTP adapters (e.g., Mint, Finch, Hackney) to optimize performance or manage dependencies.
  • Implementing middleware pipelines for tasks like authentication, logging, retries, and JSON encoding/decoding.
  • Creating flexible HTTP clients that require specific architectural decisions, such as using different transport layers.
  • Handling common HTTP tasks with built-in middleware like base URLs, headers, query parameters, redirects, and error handling.
  • Developing Elixir applications where HTTP client customization and extensibility are prioritized over simplicity.

Not Ideal For

  • Simple applications requiring only basic HTTP requests without middleware customization, where a lighter library like HTTPoison might be more straightforward.
  • Production environments with strict security requirements where using the default httpc adapter is risky and switching adapters adds unnecessary complexity.
  • Teams preferring an opinionated, batteries-included HTTP client with zero-configuration defaults, as Tesla requires manual setup of middleware and adapters.

Pros & Cons

Pros

Composable Middleware Stack

Allows chaining middleware for tasks like authentication and logging, enabling custom API clients with minimal code, as shown in the client configuration examples.

Adapter Agnostic Design

Supports swapping between HTTP adapters like Mint and Finch, giving developers flexibility in performance and dependency management, as highlighted in the adapter section.

Built-in Middleware Library

Includes ready-to-use components for JSON encoding, redirects, and error handling, reducing boilerplate for common HTTP tasks.

Flexible Client Configuration

Enables creating reusable clients with specific middleware and adapter settings, promoting code reusability across the application.

Cons

Insecure Default Adapter

The default httpc adapter does not validate SSL certificates and has known issues, forcing developers to explicitly configure a secure alternative like Mint for production.

Setup and Dependency Overhead

Requires installing additional packages like Jason for JSON middleware or Mint for adapters, adding complexity and potential bloat for simple use cases.

Learning Curve for Middleware

The composable middleware architecture demands understanding of concepts and configuration, which can be a barrier for developers new to such patterns.

Frequently Asked Questions

Quick Stats

Stars2,071
Forks363
Contributors0
Open Issues8
Last commit1 day ago
CreatedSince 2015

Tags

#elixir#adapter#http#web-requests#api-client#json#http-client#middleware

Built With

E
Elixir

Included in

Elixir13.1k
Auto-fetched 1 day ago

Related Projects

httpoisonhttpoison

Yet Another HTTP client for Elixir powered by hackney

Stars2,312
Forks340
Last commit1 month ago
mochiwebmochiweb

MochiWeb is an Erlang library for building lightweight HTTP servers.

Stars1,886
Forks464
Last commit7 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub