interface RequestData

external
interface RequestData

Represents possible data to be given to an endpoint

optionalexternal
appendToFormData? : boolean

Whether to append JSON data to form data instead of payload_json when sending files

optionalexternal
auth? : AuthData | boolean | undefined = true

Alternate authorization data to use for this request only, or false to disable the Authorization header. When making a request to a route that includes a token (such as interactions or webhooks), set to false to avoid accidentally unsetting the instance token if a 401 is encountered.

optionalexternal
body? : BodyInit | unknown

The body to send to this request. If providing as BodyInit, set passThroughBody: true

optionalexternal
dispatcher? : Agent

The Agent to use for the request.

optionalexternal
files? : RawFile[] | undefined

Files to be attached to this request

optionalexternal
headers? : Record<string, string>

Additional headers to add to this request

optionalexternal
passThroughBody? : boolean

Whether to pass-through the body property directly to fetch(). This only applies when files is NOT present

optionalexternal
query? : URLSearchParams

Query string parameters to append to the called endpoint

optionalexternal
reason? : string | undefined

Reason to show in the audit logs

optionalexternal
rejectOnRateLimit? : RateLimitQueueFilter | boolean | undefined

Determines how a rate limit encountered while making this request should be handled.Pass true to throw a RateLimitError rather than wait, false to wait it out, or a filter to decide based on rate limit data. Takes precedence over rejectOnRateLimit, so false opts this request out of an instance-wide policy. Leave it unset to inherit.

optionalexternal
signal? : AbortSignal | undefined

The signal to abort the queue entry or the REST call, where applicable

optionalexternal
versioned? : boolean = true

If this request should be versioned