mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-23 16:33:28 +00:00
4fc1a984f9
No need to implement get/post functions here Signed-off-by: Thomas Citharel <tcit@tcit.fr>
22 lines
437 B
Elixir
22 lines
437 B
Elixir
defmodule Mobilizon.Service.HTTP.BaseClient do
|
|
@moduledoc """
|
|
Tesla HTTP Basic Client
|
|
"""
|
|
|
|
use Tesla
|
|
alias Mobilizon.Config
|
|
|
|
@default_opts [
|
|
recv_timeout: 20_000
|
|
]
|
|
|
|
adapter(Tesla.Adapter.Hackney, @default_opts)
|
|
|
|
@user_agent Config.instance_user_agent()
|
|
|
|
plug(Tesla.Middleware.FollowRedirects)
|
|
|
|
plug(Tesla.Middleware.Timeout, timeout: 10_000)
|
|
|
|
plug(Tesla.Middleware.Headers, [{"User-Agent", @user_agent}])
|
|
end
|