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

Request preparation and body encoding for Tinkex API.

Handles:
- JSON body encoding
- Multipart/form-data encoding for file uploads
- Request body preparation and validation
- Content-type header management

# `format_error`

```elixir
@spec format_error(term()) :: String.t()
```

Formats error reasons from request preparation into human-readable messages.

# `prepare_body`

```elixir
@spec prepare_body(term(), [{String.t(), String.t()}], term(), keyword()) ::
  {:ok, [{String.t(), String.t()}], iodata()} | {:error, term()}
```

Prepares the request body and updates headers as needed.

For multipart requests (with files), encodes as multipart/form-data.
For regular requests, encodes body as JSON.

Returns `{:ok, headers, body}` or `{:error, reason}`.

---

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