Class MiniProgramHttpDownloadResponse<T>

Type Parameters

  • T

Hierarchy

  • HttpResponse<T>
    • MiniProgramHttpDownloadResponse

Constructors

  • Construct a new WxHttpDownloadResponse.

    Type Parameters

    • T

    Parameters

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

    Returns MiniProgramHttpDownloadResponse<T>

Properties

body: null | T

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

filePath: null | string

用户文件路径 (本地路径)。传入 filePath 时会返回,跟传入的 filePath 一致

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.

tempFilePath: null | string

临时文件路径 (本地路径)。没传入 filePath 指定文件存储路径时会返回,下载后的文件会存储到一个临时文件

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

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

Methods

Generated using TypeDoc