Skip to content

RequestData

Defined in: packages/rest/src/index.ts:157

Request options plus files (which upgrade the request to multipart) and, for get() and delete() (which take no positional body), an optional body.

optional auth?: boolean

Defined in: packages/rest/src/index.ts:144

Set false to omit the Authorization header for this request. Defaults to true.

RESTRequestOptions.auth


optional body?: unknown

Defined in: packages/rest/src/index.ts:159

Request body for get() and delete(); request(), post(), put() and patch() take theirs positionally.


optional files?: RESTFileAttachment[]

Defined in: packages/rest/src/index.ts:161

File attachments; presence upgrades the request to multipart/form-data.


optional headers?: Record<string, string>

Defined in: packages/rest/src/index.ts:140

Extra request headers merged in (library headers such as Authorization win).

RESTRequestOptions.headers


optional maxQueueWait?: number

Defined in: packages/rest/src/index.ts:150

Longest, in ms, this request may wait before it is sent: queued behind its bucket, for a rate limit, or between retries. Past it the request fails with kind "overloaded". Overrides the client’s maxQueueWait.

RESTRequestOptions.maxQueueWait


optional query?: RESTQuery

Defined in: packages/rest/src/index.ts:138

Query-string appended to the path (URLSearchParams, a record, or a raw string).

RESTRequestOptions.query


optional reason?: string

Defined in: packages/rest/src/index.ts:142

Audit-log reason, sent as the X-Audit-Log-Reason header.

RESTRequestOptions.reason


optional signal?: AbortSignal

Defined in: packages/rest/src/index.ts:136

Abort signal used to cancel the request and any queued wait.

RESTRequestOptions.signal