Skip to content

RestRequest

RestRequest = object

Defined in: packages/core/src/rest/types.ts:12

Describes an outgoing HTTP request to a platform API.

path is a relative path (e.g., “/videos”)

query values are URL-encoded by the RestManager

optional body: unknown

Defined in: packages/core/src/rest/types.ts:16


optional bodyType: "json" | "raw"

Defined in: packages/core/src/rest/types.ts:22

Body serialization format.

  • “json” (default): JSON.stringify the body and set Content-Type: application/json
  • “raw”: pass body directly to fetch (e.g., for FormData, URLSearchParams, ReadableStream)

optional bucketId: string

Defined in: packages/core/src/rest/types.ts:27

Rate limit bucket key (e.g., “videos:list”, “search:list”).


optional headers: Record<string, string>

Defined in: packages/core/src/rest/types.ts:23


method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"

Defined in: packages/core/src/rest/types.ts:13


path: string

Defined in: packages/core/src/rest/types.ts:14


optional query: Record<string, string | string[]>

Defined in: packages/core/src/rest/types.ts:15


optional signal: AbortSignal

Defined in: packages/core/src/rest/types.ts:25

AbortSignal to cancel the request.