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