A component used for making AJAX requests.

interface RequestHelper {
    createSocket(url: string): WebSocket;
    request(url: string, options?: RequestInit): Promise<Response>;
}

Implemented by

Methods

  • Create a web socket.

    Parameters

    • url: string

      The web socket URL.

    Returns WebSocket

  • Makes a web request.

    Parameters

    • url: string

      The URL of the request.

    • Optionaloptions: RequestInit

      Options for the request. See fetch() API in MDN.

    Returns Promise<Response>