1 defmodule Pleroma.HTTP.Connection do
3 Connection for http-requests.
11 @adapter Application.get_env(:tesla, :adapter)
14 Configure a client connection
20 @spec new(Keyword.t()) :: Tesla.Env.client()
21 def new(opts \\ []) do
22 Tesla.client([], {@adapter, hackney_options(opts)})
25 # fetch Hackney options
27 defp hackney_options(opts \\ []) do
28 options = Keyword.get(opts, :adapter, [])
29 @hackney_options ++ options