🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## response 语法 ``` interface Body { readonly body: ReadableStream<Uint8Array> | null; readonly bodyUsed: boolean; arrayBuffer(): Promise<ArrayBuffer>; blob(): Promise<Blob>; formData(): Promise<FormData>; json(): Promise<any>; // 转换 json text(): Promise<string>; } interface Response extends Body { readonly headers: Headers; readonly ok: boolean; // HTTP CODE 在 200-299 之间,则为true readonly redirected: boolean; readonly status: number; // 状态码 readonly statusText: string; readonly type: ResponseType; readonly url: string; // 请求的url clone(): Response; } declare var Response: { prototype: Response; new(body?: BodyInit | null, init?: ResponseInit): Response; error(): Response; redirect(url: string | URL, status?: number): Response; }; ```