8.7 released—WinterCG Compliance Part 1
Learn more

Summary

References

Functions

getBinary

getBinary(url: string): Promise<ArrayBuffer>
Downloads the content from the specified URL as binary and returns an ArrayBuffer.
Parameter Default Description
url
string

The URL to request from.

Returns Promise<ArrayBuffer>
getBinary(options: HttpRequestOptions): Promise<ArrayBuffer>
Downloads the content from the specified URL as binary and returns an ArrayBuffer.
Parameter Default Description
options

An object that specifies various request options.

Returns Promise<ArrayBuffer>

getFile

getFile(url: string, destinationFilePath?: string): Promise<File>
Downloads the content from the specified URL and attempts to save it as file.
Parameter Default Description
url
string

The URL to request from.

destinationFilePath
string

Optional. The downloaded file path.

Returns Promise<File>
getFile(options: HttpRequestOptions, destinationFilePath?: string): Promise<File>
Downloads the content from the specified URL and attempts to save it as file.
Parameter Default Description
options

An object that specifies various request options.

destinationFilePath
string

Optional. The downloaded file path.

Returns Promise<File>

getImage

getImage(url: string): Promise<ImageSource>
Downloads the content from the specified URL and attempts to decode it as an image.
Parameter Default Description
url
string

The URL to request from.

Returns Promise<ImageSource>
getImage(options: HttpRequestOptions): Promise<ImageSource>
Downloads the content from the specified URL and attempts to decode it as an image.
Parameter Default Description
options

An object that specifies various request options.

Returns Promise<ImageSource>

getJSON

getJSON&lt;T&gt;(url: string): Promise&lt;T&gt;
Downloads the content from the specified URL as a string and returns its JSON.parse representation.
Parameter Default Description
url
string

The URL to request from.

Returns Promise<T>
getJSON<T>(options: HttpRequestOptions): Promise<T>
Downloads the content from the specified URL as a string and returns its JSON.parse representation.
Parameter Default Description
options

An object that specifies various request options.

Returns Promise<T>

getString

getString(url: string): Promise&lt;string&gt;
Downloads the content from the specified URL as a string.
Parameter Default Description
url
string

The URL to request from.

Returns Promise<string>
getString(options: HttpRequestOptions): Promise<string>
Downloads the content from the specified URL as a string.
Parameter Default Description
options

An object that specifies various request options.

Returns Promise<string>

request

request(options: HttpRequestOptions): Promise<HttpResponse>
Makes a generic http request using the provided options and returns a HttpResponse Object.
Parameter Default Description
options

An object that specifies various request options.

Returns Promise<HttpResponse>
Previous
GridUnitType