Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Http

HTTP类

Hierarchy

  • Http

Index

Properties

Methods

Properties

Static _ON

_ON: JsonObject<(res: HttpResponse) => void>

Methods

Static get

Static on

  • A function to be called when any request finishes (after success and error callbacks are executed).

    Parameters

    Returns any

  • A function to be called if any request succeeds.

    Parameters

    Returns any

  • A function to be called if any request fails.

    Parameters

    Returns any

Static post

Static send

Static sendBeacon

  • sendBeacon(e: "beforeunload" | "unload", fn: (evt: Event) => void, scope?: any): void
  • Allows data to be sent asynchronously to a server with navigator.sendBeacon, even after a page was closed. Useful for posting analytics data the moment a user was finished using the page.

    Parameters

    • e: "beforeunload" | "unload"
    • fn: (evt: Event) => void
        • (evt: Event): void
        • Parameters

          • evt: Event

          Returns void

    • Optional scope: any

    Returns void

Static toRequest

Static upload

  • Upload a file blob.

    Parameters

    • file: { data: Blob; fileName?: string; postName?: string } | FormData
    • url: URLString

    Returns Promise<HttpResponse>