API Reference tesla v#1.20.0

Copy Markdown View Source

Modules

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.

Bearer authentication middleware.

Only compress request.

Compress requests and decompress responses.

Raised when a response cannot be safely decompressed.

Decodes response body as JSON.

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

Only decompress response.

Digest access authentication middleware.

Encodes request body as JSON.

Follow HTTP 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 URL, body, and headers into :opts.

Log requests using Elixir's Logger.

Encode requests and decode responses as MessagePack.

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 provided parameters in either Phoenix style (:id) or OpenAPI style ({id}).

Set default query params or serialize OpenAPI-style query values.

Retry using exponential backoff and full jitter.

Decode Server Sent Events.

Emits events using the :telemetry library to expose instrumentation.

Timeout HTTP request after X milliseconds.

Tesla.Mock deprecated

Mock adapter for better testing.

Multipart functionality.

Reference entry point for OpenAPI-compatible generated clients.

A cookie parameter with explicit serialization settings.

A collection of cookie parameter definitions.

A header parameter with explicit serialization settings.

A collection of header parameter definitions.

A path parameter definition with explicit serialization settings.

A collection of path parameter definitions for Tesla.Middleware.PathParams.

A precompiled OpenAPI Path Templating path.

A query parameter definition with explicit serialization settings.

A collection of query parameter definitions for Tesla.Middleware.Query.

A whole URL query string with explicit serialization.

Raised when a whole Tesla.OpenAPI.QueryString cannot own the request query string.

Macro for defining generated-client response wrappers.

Provides utilities for testing Tesla-based HTTP clients.