tesla v1.3.0 API Reference

Modules

A HTTP toolkit for building API clients using middlewares

The adapter specification

Adapter for [gun] https://github.com/ninenines/gun

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. Performs encoding of body from a Map such as %{"foo" => "bar"} into url encoded data. Performs decoding of the response into a map when urlencoded and content-type is application/x-www-form-urlencoded, so "foo=bar" becomes %{"foo" => "bar"}.

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.

Send the request time and meta-information through telemetry.

Timeout http request after X seconds.

Mock adapter for better testing.

Multipart functionality.

Exceptions