This is a base class for communication with an arbitrary Nextspace API.

Hierarchy

Constructors

Properties

Cache: CacheControl<any>
baseUrl: string = ""
env: string

Methods

  • Performs an HTTP DELETE request. This will prepend the base url to the url.

    Parameters

    Returns Promise<any>

  • Performs an HTTP GET request. This will prepend the base url to the url.

    Parameters

    Returns Promise<any>

  • Returns a cache item matching the provided key. If the reqParams specify that caching is disabled, null is returned.

    Parameters

    Returns {
        data: any;
        found: boolean;
    }

    • data: any
    • found: boolean
  • Performs an HTTP POST request. This will prepend the base url to the url.

    Parameters

    • url: string
    • data: any
    • Optional params: IReqParams

    Returns Promise<any>

  • Sets a cache item matching the provided key. If the reqParams specify that caching is disabled, then no action is taken.

    Parameters

    • params: {
          duration?: number;
          key: string;
          req?: IReqParams;
          value: any;
      }
      • Optional duration?: number
      • key: string
      • Optional req?: IReqParams
      • value: any

    Returns void

  • Performs a file upload request (HTTP POST). This will prepend the base url to the url.

    Parameters

    Returns Promise<any>

  • Performs a DELETE request. This will NOT prepend the base URL to the provided URL.

    Parameters

    Returns Promise<any>

  • Performs a GET request. This will NOT prepend the base URL to the provided URL.

    Parameters

    Returns Promise<any>

  • post(url, data, params?): Promise<any>
  • Performs a POST request. This will NOT prepend the base URL to the provided URL.

    Parameters

    • url: string
    • data: any
    • Optional params: IReqParams

    Returns Promise<any>

  • Performs a PUT request. This will NOT prepend the base URL to the provided URL.

    Parameters

    • url: string
    • data: any
    • Optional params: IReqParams

    Returns Promise<any>

  • Performs a file upload (POST) request. This will NOT prepend the base URL to the provided URL.

    Parameters

    Returns Promise<any>

Generated using TypeDoc