Base class for services to communicate with routes of the server application

All requests will include a header with the player session id

Hierarchy (View Summary)

Constructors

Properties

_playerService: PlayerService = ...

Instance of the player service

Methods

  • Perform a GET request and retrieve a JSON response

    Type Parameters

    • T1

      Return type of the function

    • T2 = unknown

      Type of query string attributes

    Parameters

    • path: string

      Url to request

    • Optionaldata: T2

      Optional object to use for the query string attributes

    Returns Promise<T1>

    JSON object of the response, otherwise undefined.

  • Perform any type of request and retrieve a JSON response

    Type Parameters

    • T1

      Return type of the function

    • T2 = unknown

      Type of request body

    Parameters

    • method: string

      Method to use for the request

    • path: string

      Url to request

    • Optionaldata: T2

      Optional object to include in the body of the request

    Returns Promise<T1>

    JSON object of the response, otherwise undefined.

  • Perform a POST request and retrieve a JSON response

    Type Parameters

    • T1

      Return type of the function

    • T2 = unknown

      Type of request body

    Parameters

    • path: string

      Url to request

    • Optionaldata: T2

      Optional object to include in the body of the request

    Returns Promise<T1>

    JSON object of the response, otherwise undefined.