# Call options (https://effetch.monarcode.dev/docs/calls/options)

Every method takes a path and an object of options, such as
`api.get("/todos/:id", { params: { id: 1 }, output: Todo })`. Use this page
to look an option up. Each row links to the page that explains it in full.

## Options

The following table lists every option a call accepts, with what a call
without it does:

| Option         | What it does                                                                                                                                                                                                                                 | Default                                                              |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `params`       | Fills in the path's `:name` segments. Required when the path has any, and not allowed otherwise. See [Fill in path parameters](https://effetch.monarcode.dev/docs/calls#fill-in-path-parameters).                                                                         | None.                                                                |
| `query`        | Builds the query string from an object. See [Build a query string](https://effetch.monarcode.dev/docs/calls#build-a-query-string).                                                                                                                                        | None.                                                                |
| `headers`      | Headers for this call. They win over the client's, and over the body's `content-type`, except on a `FormData` body. See [Set the content type](https://effetch.monarcode.dev/docs/calls/body#set-the-content-type).                                                       | The client's headers.                                                |
| `body`         | The request body, sent by its type. Only on `post`, `put`, `patch`, `del` and `request`, and on `sse` and `ndjson`. See [Send a body](https://effetch.monarcode.dev/docs/calls/body).                                                                                     | None: no body.                                                       |
| `input`        | A schema that types `body` and encodes it. A body that doesn't match makes the call die. See [Encode the body with a schema](https://effetch.monarcode.dev/docs/calls/body#encode-the-body-with-a-schema), and [Upload files](https://effetch.monarcode.dev/docs/calls/uploads) for `Fetch.multipart`. | None: `body` is sent by its type.                                    |
| `output`       | A schema the 2xx body is decoded with. See [Read the response](https://effetch.monarcode.dev/docs/calls/responses).                                                                                                                                                       | None: the call succeeds with the `HttpClientResponse`.               |
| `responseMode` | `"decoded-and-response"` makes the call succeed with `[value, response]`. See [Read the body and the response](https://effetch.monarcode.dev/docs/calls/responses#read-the-body-and-the-response).                                                                        | `"decoded"`: the value alone.                                        |
| `error`        | A schema for the body of error responses, decoded onto `HttpError.body`. See [Catch errors](https://effetch.monarcode.dev/docs/errors/catching#read-the-error-body).                                                                                                      | The client's `defaultError`, else `Schema.Unknown`: the parsed JSON. |
| `statusErrors` | Your own errors for error responses, by status. Tried before the client's. See [Errors by status](https://effetch.monarcode.dev/docs/errors/status-errors).                                                                                                               | None: only the client's apply.                                       |
| `plugins`      | Turns a plugin off, or changes its options, for this call. See [Change plugins for one call](https://effetch.monarcode.dev/docs/plugins/per-call).                                                                                                                        | None: each plugin runs with its defaults.                            |

These are the options of the client's methods. An endpoint's call takes a
subset of them, since its definition holds the rest (see
[Call an endpoint](https://effetch.monarcode.dev/docs/endpoints/calling)).

`api.request` takes the same options, after the HTTP method. A `GET` or
`HEAD` request with a `body` makes the call die (see
[When the methods aren't enough](https://effetch.monarcode.dev/docs/calls/http-client)).

## What's next

- [Make a call](https://effetch.monarcode.dev/docs/calls): pick a method, and fill in the path and the
  query.
- [Send a body](https://effetch.monarcode.dev/docs/calls/body): send JSON, a form, text or bytes.
- [Read the response](https://effetch.monarcode.dev/docs/calls/responses): decode what comes back with a
  schema.