# `Tinkex.API.Response`
[🔗](https://github.com/North-Shore-AI/tinkex/blob/v0.4.0/lib/tinkex/api/response.ex#L1)

Wrapper around HTTP responses with metadata and parsing helpers.

# `t`

```elixir
@type t() :: %Tinkex.API.Response{
  body: binary(),
  data: term() | nil,
  elapsed_ms: non_neg_integer(),
  headers: map(),
  method: atom(),
  retries: non_neg_integer(),
  status: integer(),
  url: String.t()
}
```

# `header`

```elixir
@spec header(t(), String.t()) :: String.t() | nil
```

Retrieve a header value (case-insensitive).

# `new`

```elixir
@spec new(
  Finch.Response.t(),
  keyword()
) :: t()
```

Build a response wrapper from a Finch response.

# `parse`

```elixir
@spec parse(t(), module() | (term() -&gt; term()) | nil) ::
  {:ok, term()} | {:error, term()}
```

Parse the response body using a module or function.

- Module parser: must export `from_json/1`
- Function parser: unary function that accepts the decoded JSON
- nil parser: returns the decoded JSON map

---

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