mojito v0.7.5 Mojito.Base behaviour 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
Link to this type
body()
View Source
body()
View Source
body() :: String.t()
body() :: String.t()
Link to this type
error() View Source
Link to this type
header() View Source
Link to this type
headers()
View Source
headers()
View Source
headers() :: [header()]
headers() :: [header()]
Link to this type
method()
View Source
method()
View Source
method() ::
:head | :get | :post | :put | :patch | :delete | :options | String.t()
method() :: :head | :get | :post | :put | :patch | :delete | :options | String.t()
Link to this type
payload()
View Source
payload()
View Source
payload() :: String.t()
payload() :: String.t()
Link to this type
pool_opt()
View Source
pool_opt()
View Source
pool_opt() ::
{:size, pos_integer()}
| {:max_overflow, non_neg_integer()}
| {:pools, pos_integer()}
| {:strategy, :lifo | :fifo}
pool_opt() :: {:size, pos_integer()} | {:max_overflow, non_neg_integer()} | {:pools, pos_integer()} | {:strategy, :lifo | :fifo}
Link to this type
pool_opts() View Source
Link to this type
request() View Source
Link to this type
request_field() View Source
Link to this type
request_kwlist()
View Source
request_kwlist()
View Source
request_kwlist() :: [request_field()]
request_kwlist() :: [request_field()]
Link to this type
response()
View Source
response()
View Source
response() :: %Mojito.Response{
body: String.t(),
complete: boolean(),
headers: headers(),
size: term(),
status_code: pos_integer()
}
response() :: %Mojito.Response{ body: String.t(), complete: boolean(), headers: headers(), size: term(), status_code: pos_integer() }
Link to this type
url()
View Source
url()
View Source
url() :: String.t()
url() :: String.t()
Link to this section Callbacks
Link to this callback
delete(url) View Source
Link to this callback
delete(url, headers) View Source
Link to this callback
delete(url, headers, arg2) View Source
Link to this callback
get(url) View Source
Link to this callback
get(url, headers) View Source
Link to this callback
get(url, headers, arg2) View Source
Link to this callback
head(url) View Source
Link to this callback
head(url, headers) View Source
Link to this callback
head(url, headers, arg2) View Source
Link to this callback
options(url) View Source
Link to this callback
options(url, headers) View Source
Link to this callback
options(url, headers, arg2) View Source
Link to this callback
patch(url) View Source
Link to this callback
patch(url, headers) View Source
Link to this callback
patch(url, headers, payload) View Source
Link to this callback
patch(url, headers, payload, arg3) View Source
Link to this callback
post(url) View Source
Link to this callback
post(url, headers) View Source
Link to this callback
post(url, headers, payload) View Source
Link to this callback
post(url, headers, payload, arg3) View Source
Link to this callback
put(url) View Source
Link to this callback
put(url, headers) View Source
Link to this callback
put(url, headers, payload) View Source
Link to this callback
put(url, headers, payload, arg3) View Source
Link to this callback
request(arg0)
View Source
request(arg0)
View Source
request(request() | request_kwlist()) :: {:ok, response()} | {:error, error()}
request(request() | request_kwlist()) :: {:ok, response()} | {:error, error()}
Link to this callback
request(method, url) View Source
Link to this callback
request(method, url, headers) View Source
Link to this callback
request(method, url, headers, body) View Source
Link to this callback