View Source Tw.HTTP.Client behaviour (Tw v0.1.1)

HTTP Client contract.

Link to this section Summary

Types

Module which implements the Tw.HTTP.Client behavior.

Callbacks

Callback to make an HTTP request.

Link to this section Types

Specs

body() :: binary()

Specs

header() :: {binary(), binary()}

Specs

implementation() :: module()

Module which implements the Tw.HTTP.Client behavior.

Specs

method() :: atom()

Specs

options() :: keyword()

Specs

response() :: %{status: status(), headers: [header()], body: body()}

Specs

result() :: {:ok, response()} | {:error, Exception.t()}

Specs

status() :: non_neg_integer()

Specs

url() :: binary()

Link to this section Callbacks

Link to this callback

request(method, url, list, body, options)

View Source

Specs

request(method(), url(), [header()], body(), options()) :: result()

Callback to make an HTTP request.