Skip to main content

SendRequestOptions

@discordeno/rest


Documentation / @discordeno/rest / SendRequestOptions

Interface: SendRequestOptions

Defined in: rest/src/types.ts:3187

Properties

bucketId?

optional bucketId: string

Defined in: rest/src/types.ts:3201

If this request has a bucket id which it falls under for rate limit


method

method: RequestMethods

Defined in: rest/src/types.ts:3191

The method to use for sending the request.


reject()

reject: (value) => void

Defined in: rest/src/types.ts:3199

Reject handler when a request fails.

Parameters

value

RestRequestRejection

Returns

void


requestBodyOptions?

optional requestBodyOptions: CreateRequestBodyOptions

Defined in: rest/src/types.ts:3203

Additional request options, used for things like overriding authorization header.


resolve()

resolve: (value) => void

Defined in: rest/src/types.ts:3197

Resolve handler when a request succeeds.

Parameters

value

RestRequestResponse

Returns

void


retryCount

retryCount: number

Defined in: rest/src/types.ts:3193

The amount of times this request has been retried.


retryRequest()?

optional retryRequest: (options) => Promise<void>

Defined in: rest/src/types.ts:3195

Handler to retry a request should it be rate limited.

Parameters

options

SendRequestOptions

Returns

Promise<void>


route

route: string

Defined in: rest/src/types.ts:3189

The route to send the request to.


runThroughQueue?

optional runThroughQueue: boolean

Defined in: rest/src/types.ts:3208

Whether the request should be run through the queue. Useful for routes which do not have any rate limits.