平台请求适配器的请求配置。

interface RequestConfig {
    url: string;
    method?: HttpMethod;
    headers?: Record<string, string>;
    body?: string | Uint8Array<ArrayBufferLike> | Record<string, unknown>;
    responseType?: "json" | "text" | "arraybuffer";
    timeoutMs?: number;
    signal?: AbortSignal;
}

Properties

url: string

请求 URL。

method?: HttpMethod

HTTP 方法,默认由调用方决定。

headers?: Record<string, string>

请求头。

body?: string | Uint8Array<ArrayBufferLike> | Record<string, unknown>

请求体。

responseType?: "json" | "text" | "arraybuffer"

期望的响应数据类型。

timeoutMs?: number

请求超时时间,单位毫秒。

signal?: AbortSignal

请求取消信号。