Mojito.Base behaviour (mojito v0.7.12) View Source
Provides a default implementation for Mojito functions.
This module is meant to be use
'd in custom modules in order to wrap the
functionalities provided by Mojiti. For example, this is very useful to
build custom API clients around Mojito:
defmodule CustomAPI do
use Mojito.Base
end
Link to this section Summary
Link to this section Types
Specs
body() :: String.t()
Specs
Specs
Specs
headers() :: [header()]
Specs
method() :: :head | :get | :post | :put | :patch | :delete | :options | String.t()
Specs
payload() :: String.t()
Specs
pool_opt() :: {:size, pos_integer()} | {:max_overflow, non_neg_integer()} | {:pools, pos_integer()} | {:strategy, :lifo | :fifo}
Specs
Specs
Specs
Specs
request_kwlist() :: [request_field()]
Specs
response() :: %Mojito.Response{ body: String.t(), complete: boolean(), headers: headers(), size: term(), status_code: pos_integer() }
Specs
url() :: String.t()
Link to this section Callbacks
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
Specs
request(request() | request_kwlist()) :: {:ok, response()} | {:error, error()}