@impl true
def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
- http_opts = Keyword.put(http_opts, :adapter, pool: :upload)
+ http_opts = Keyword.put_new(http_opts, :adapter, pool: :upload)
case HTTP.request(method, url, body, headers, http_opts) do
{:ok, env} ->
@impl true
def get(url, headers, options) do
- options = Keyword.put(options, :adapter, pool: :upload)
+ options = Keyword.put_new(options, :adapter, pool: :upload)
with {:ok, %Tesla.Env{} = env} <- HTTP.get(url, headers, options) do
{:ok, {env.status, env.headers, env.body}}
@impl true
def head(url, headers, options) do
- options = Keyword.put(options, :adapter, pool: :upload)
+ options = Keyword.put_new(options, :adapter, pool: :upload)
with {:ok, %Tesla.Env{} = env} <- HTTP.head(url, headers, options) do
{:ok, {env.status, env.headers}}