Waffle.HTTPClient.Req (waffle v2.0.0)

Copy Markdown View Source

HTTP client adapter that uses Req to download remote files.

Installation

Add the :req dependency to mix.exs:

{:req, "~> 0.7"}

Configure Waffle to use this adapter:

config :waffle,
  http_client: Waffle.HTTPClient.Req

This adapter is used only when Waffle downloads a remote URL. It does not configure S3 requests made by Waffle.Storage.S3, which are handled by ExAws.

Timeouts, redirects, retries, and response body limits are configured through the :waffle :request option. See the request configuration for supported options and defaults.

Req-specific options

Additional options can be passed directly to Req.new/1. See the Req.new/1 documentation for the available options.

config :waffle, Waffle.HTTPClient.Req,
  request_options: [
    pool_timeout: 5_000
  ]

These options are merged after Waffle's request options and therefore take precedence. Prefer the request configuration for options supported directly by Waffle.

When :finch is configured, Waffle does not set Req's :connect_options because Req does not allow both options. Configure the connection timeout on the Finch pool instead; Waffle's :connect_timeout_ms does not apply in that case.