HttpClient class

Abstraction over an HTTP client. This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.

Methods

delete

Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

delete

Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

get

Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

get

Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

post

Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

post

Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

send

Issues an HTTP request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

Method Details

delete

Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function delete(url: string)

Parameters

url
string

The URL for the request.

Returns

delete

Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function delete(url: string, options: HttpRequest)

Parameters

url
string

The URL for the request.

options
HttpRequest

Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.

Returns

get

Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function get(url: string)

Parameters

url
string

The URL for the request.

Returns

get

Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function get(url: string, options: HttpRequest)

Parameters

url
string

The URL for the request.

options
HttpRequest

Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.

Returns

post

Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function post(url: string)

Parameters

url
string

The URL for the request.

Returns

post

Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function post(url: string, options: HttpRequest)

Parameters

url
string

The URL for the request.

options
HttpRequest

Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.

Returns

send

Issues an HTTP request to the specified URL, returning a Promise that resolves with an HttpResponse representing the result.

function send(request: HttpRequest)

Parameters

request
HttpRequest

An HttpRequest describing the request to send.

Returns