View Source Tesla.Middleware.Compression (tesla v1.7.0)

Compress requests and decompress responses.

Supports "gzip" and "deflate" encodings using Erlang's built-in :zlib module.

examples

Examples

defmodule MyClient do
  use Tesla

  plug Tesla.Middleware.Compression, format: "gzip"
end

options

Options

  • :format - request compression format, "gzip" (default) or "deflate"

Link to this section Summary

Functions

Compress request.

Decompress response.

Link to this section Functions

Compress request.

It is used by Tesla.Middleware.CompressRequest.

Decompress response.

It is used by Tesla.Middleware.DecompressResponse.