API Reference tesla v1.4.0


A HTTP toolkit for building API clients using middlewares

The adapter specification.

Adapter for finch.

Adapter for gun.

Adapter for httpc.

Adapter for mint.

This module defines a Tesla.Env.t/0 struct that stores all data related to request/response.

The middleware specification

Set base URL for all requests.

Basic authentication middleware.

Only compress request.

Compress requests and decompress responses.

Decode Link Hypermedia HTTP header into opts[:rels] field in response.

Only decompress response.

Digest access authentication middleware

Follow 3xx redirects

Send request body as application/x-www-form-urlencoded.

Circuit Breaker middleware using fuse

Set default headers for all requests

Encode requests and decode responses as JSON.

Store request body & headers into opts.

Log requests using Elixir's Logger.

Middleware that adds X-Http-Method-Override header with original request method and sends the request as post.

Set default opts for all requests.

Use templated URLs with separate params.

Set default query params for all requests

Retry using exponential backoff and full jitter. This middleware only retries in the case of connection errors (nxdomain, connrefused etc). Application error checking for retry can be customized through :should_retry option by providing a function in returning a boolean.

Emits events using the :telemetry library to expose instrumentation.

Timeout http request after X milliseconds.

Mock adapter for better testing.

Multipart functionality.