Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing a request to the API

Hierarchy

  • APIRequest

Index

Constructors

Properties

baseUrl: string

The base url of this request

body?: Json

The JSON body to send

headers: OutgoingHttpHeaders

Headers to be sent in the request

Method used for this request

path: `/${string}`

The path of this request

query: URLSearchParams

Query applied to the request

rest: Rest

The rest manager client that instantiated this

status: RequestStatus = RequestStatus.Pending

The status of this request

Accessors

  • get url(): string

Methods

  • editHeaders(headers: undefined | OutgoingHttpHeaders): APIRequest
  • Edit headers for this request

    Parameters

    • headers: undefined | OutgoingHttpHeaders

      Headers to add/remove

    Returns APIRequest

    • The new request
  • make(resolve: ((value: Response | PromiseLike<Response>) => void), reject: ((reason?: any) => void), chunk?: string | FormData): void
  • Make the request to the API.

    Parameters

    • resolve: ((value: Response | PromiseLike<Response>) => void)

      A function to resolve the promise

    • reject: ((reason?: any) => void)

      A function to reject the promise

        • (reason?: any): void
        • Parameters

          • Optional reason: any

          Returns void

    • Optional chunk: string | FormData

      The chunk to send

    Returns void

  • Send the request to the api.

    Returns Promise<Response>

    • A promise with the data received from the API or null if there is no data

Generated using TypeDoc