# `Brasilapi.Client`
[🔗](https://github.com/stlucasgarcia/brasilapi-ex/blob/main/lib/brasilapi/client.ex#L1)

HTTP client for BrasilAPI endpoints.

Provides a consistent interface for making HTTP requests to BrasilAPI
with proper error handling, retries, and response parsing.

# `error_response`

```elixir
@type error_response() :: {:error, map()}
```

# `mapper`

```elixir
@type mapper(result, mapped) :: (result -&gt; mapped)
```

# `response`

```elixir
@type response() :: success_response() | error_response()
```

# `success_response`

```elixir
@type success_response() :: {:ok, term()}
```

# `delete`

```elixir
@spec delete(
  String.t(),
  keyword()
) :: response()
```

Makes a DELETE request to the specified path.

## Parameters

  * `path` - The API path (without base URL)
  * `opts` - Additional options (optional)

# `get`

```elixir
@spec get(
  String.t(),
  keyword()
) :: response()
```

Makes a GET request to the specified path.

## Parameters

  * `path` - The API path (without base URL)
  * `opts` - Additional options (optional)

## Examples

    iex> Brasilapi.Client.get("/banks/v1")
    {:ok, [%{"ispb" => "00000000", "name" => "BCO DO BRASIL S.A.", ...}]}
    
    iex> Brasilapi.Client.get("/banks/v1/999999")
    {:error, %{status: 404, message: "Not found"}}

# `post`

```elixir
@spec post(String.t(), term(), keyword()) :: response()
```

Makes a POST request to the specified path.

## Parameters

  * `path` - The API path (without base URL)
  * `body` - The request body
  * `opts` - Additional options (optional)

# `put`

```elixir
@spec put(String.t(), term(), keyword()) :: response()
```

Makes a PUT request to the specified path.

## Parameters

  * `path` - The API path (without base URL)
  * `body` - The request body
  * `opts` - Additional options (optional)

---

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