RequestBuilder
Constructors
constructor
- new
Request Builder(baseUrl: string): RequestBuilder
-
Constructs a new RequestBuilder.
ParametersReturns RequestBuilder
Methods
Abstract download
- download<T>(url: string, init?: RequestOptions): Promise<T>
-
Implement this function to download the given url as JSON object.
Type ParametersParameters-
url: string
The URL to download.
-
Optional init: RequestOptions
Returns Promise<T> -
Abstract download Blob
- download
Blob(url: string, init?: RequestOptions): Promise<Response>
-
Implement this function to download the given url as Blob object.
Parameters-
url: string
The URL to download.
-
Optional init: RequestOptions
Returns Promise<Response> -
request
- request<T>(urlObj: UrlBuilder, init?: RequestOptions): Promise<T>
-
Helper method to download the resource.
Type ParametersParameters-
urlObj: UrlBuilder
the URL to fetch.
-
Optional init: RequestOptions
Returns Promise<T> -
request Blob
- request
Blob(urlObj: UrlBuilder, init?: RequestOptions): Promise<Response>
-
Helper method to download the resource.
Parameters-
urlObj: UrlBuilder
the URL to fetch.
-
Optional init: RequestOptions
Returns Promise<Response> -
Abstract class used for building requests to a REST API.