Class MiniProgramHttpResponse<T>

Type Parameters

  • T

Hierarchy

  • HttpResponse<T>
    • MiniProgramHttpResponse

Constructors

  • Construct a new WxHttpResponse.

    Type Parameters

    • T

    Parameters

    • init: {
          body?: null | T;
          cookies?: string[];
          headers?: HttpHeaders;
          profile?: RequestProfile;
          status?: number;
          statusText?: string;
          url?: string;
      } = {}
      • Optional body?: null | T
      • Optional cookies?: string[]
      • Optional headers?: HttpHeaders
      • Optional profile?: RequestProfile
      • Optional status?: number
      • Optional statusText?: string
      • Optional url?: string

    Returns MiniProgramHttpResponse<T>

Properties

body: null | T

The response body, or null if one was not returned.

cookies: null | string[]

开发者服务器返回的 cookies,格式为字符串数组

headers: HttpHeaders

All response headers.

ok: boolean

Whether the status code falls in the 2xx range.

profile: null | RequestProfile

网络请求过程中一些调试信息,查看详细说明

status: number

Response status code.

statusText: string

Textual description of response status code, defaults to OK.

Do not depend on this.

type: Response = HttpEventType.Response
url: null | string

URL of the resource retrieved, or null if not available.

Methods

  • Returns MiniProgramHttpResponse<T>

  • Parameters

    • update: {
          cookies?: string[];
          headers?: HttpHeaders;
          profile?: RequestProfile;
          status?: number;
          statusText?: string;
          url?: string;
      }
      • Optional cookies?: string[]
      • Optional headers?: HttpHeaders
      • Optional profile?: RequestProfile
      • Optional status?: number
      • Optional statusText?: string
      • Optional url?: string

    Returns MiniProgramHttpResponse<T>

  • Type Parameters

    • V

    Parameters

    • update: {
          body?: null | V;
          cookies?: string[];
          headers?: HttpHeaders;
          profile?: RequestProfile;
          status?: number;
          statusText?: string;
          url?: string;
      }
      • Optional body?: null | V
      • Optional cookies?: string[]
      • Optional headers?: HttpHeaders
      • Optional profile?: RequestProfile
      • Optional status?: number
      • Optional statusText?: string
      • Optional url?: string

    Returns MiniProgramHttpResponse<V>

Generated using TypeDoc