# `Mojentic.HTTP`
[🔗](https://github.com/svetzal/mojentic-ex/blob/v1.5.0/lib/mojentic/http.ex#L1)

Behaviour for HTTP clients used by Mojentic gateways.

This behaviour abstracts the HTTP client, allowing different
implementations for production and testing.

# `headers`

```elixir
@type headers() :: [{String.t(), String.t()}]
```

# `response`

```elixir
@type response() :: %{status_code: integer(), body: String.t(), headers: headers()}
```

# `get`

```elixir
@callback get(url :: String.t(), headers :: headers(), opts :: keyword()) ::
  {:ok, response()} | {:error, term()}
```

# `post`

```elixir
@callback post(
  url :: String.t(),
  body :: String.t(),
  headers :: headers(),
  opts :: keyword()
) ::
  {:ok, response()} | {:error, term()}
```

# `post_stream`

```elixir
@callback post_stream(
  url :: String.t(),
  body :: String.t(),
  headers :: headers(),
  opts :: keyword()
) :: {:ok, Enumerable.t()} | {:error, term()}
```

---

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