Nadia. HTTPClient behaviour
(nadia v1.4.0)
View Source
Behaviour for Nadia HTTP adapters.
Custom adapters receive a Nadia.HTTPRequest and return either
{:ok, %Nadia.HTTPResponse{}} or {:error, reason}. Applications usually do
not call this module directly, but tests and custom transports may pass an
adapter module through Nadia.Client.new/1.
Summary
Callbacks
@callback post(Nadia.HTTPRequest.t()) :: {:ok, Nadia.HTTPResponse.t()} | {:error, term()}
Functions
@spec default_adapter() :: module()
@spec post(Nadia.HTTPRequest.t()) :: {:ok, Nadia.HTTPResponse.t()} | {:error, term()}
@spec post(module(), Nadia.HTTPRequest.t()) :: {:ok, Nadia.HTTPResponse.t()} | {:error, term()}