# `Swoosh.ApiClient`
[🔗](https://github.com/swoosh/swoosh/blob/v1.25.0/lib/swoosh/api_client.ex#L1)

Specification for a Swoosh API client.

It can be set to your own client with:

    config :swoosh, :api_client, MyAPIClient

Swoosh comes with `Swoosh.ApiClient.Hackney`, `Swoosh.ApiClient.Finch`, and
`Swoosh.ApiClient.Req`.

# `body`

```elixir
@type body() :: binary()
```

# `headers`

```elixir
@type headers() :: [{binary(), binary()}]
```

# `status`

```elixir
@type status() :: pos_integer()
```

# `url`

```elixir
@type url() :: binary()
```

# `init`
*optional* 

```elixir
@callback init() :: :ok
```

Callback to initializes the given api client.

# `post`

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

Callback invoked when posting to a given URL.

# `post`

API used by adapters to post to a given URL with headers, body, and email.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
