1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.HTTP.Connection do
7 Connection for http-requests.
15 @adapter Application.get_env(:tesla, :adapter)
18 Configure a client connection
24 @spec new(Keyword.t()) :: Tesla.Env.client()
25 def new(opts \\ []) do
26 Tesla.client([], {@adapter, hackney_options(opts)})
29 # fetch Hackney options
31 defp hackney_options(opts) do
32 options = Keyword.get(opts, :adapter, [])
33 @hackney_options ++ options