Swoosh.ApiClient behaviour (Swoosh v1.3.3) View Source

Specification for a Swoosh API client.

It can be set to your own client with:

config :swoosh, :api_client, MyAPIClient

Link to this section Summary

Functions

API used by adapters to post to a given URL with headers, body, and e-mail.

Callbacks

Callback to initializes the given api client.

Callback invoked when posting to a given URL.

Link to this section Types

Specs

body() :: binary()

Specs

headers() :: [{binary(), binary()}]

Specs

status() :: pos_integer()

Specs

url() :: binary()

Link to this section Functions

Link to this function

post(url, headers, body, email)

View Source

API used by adapters to post to a given URL with headers, body, and e-mail.

Link to this section Callbacks

Specs

init() :: :ok

Callback to initializes the given api client.

Link to this callback

post(url, headers, body, arg4)

View Source

Specs

post(url(), headers(), body(), Swoosh.Email.t()) ::
  {:ok, status(), headers(), body()} | {:error, term()}

Callback invoked when posting to a given URL.