Timber v1.1.4 Timber.Transports.HTTP.Client behaviour
Behavior for custom HTTP clients. If you opt not to use the default Timber HTTP client
(Timber.Transports.HTTP.HackneyClient
) you can define your own here.
Example
defmodule MyHTTPClient do
alias Timber.Transports.HTTP.Client
@behaviour Client
@spec request(Client.method, Client.url, Client.headers, Client.body, Client.options) ::
{:ok, Client.status, Client.Headers, Client.body} | {:error, any()}
def request(method, url, headers, body, opts) do
# make request here
end
end
Then specify it in your configuration:
config :timber, :http_transport, http_client: MyHTTPClient