Class: HTTPService

HTTPService() → {HTTPService}

Convenience wrapper for HTTP service (not meant to be instantiated directly).

Constructor

new HTTPService() → {HTTPService}

Returns:

a HTTPService instance.

Type
HTTPService

Methods

delete(urlOrOptions, optionsopt) → {Promise}

Send a DELETE request to a resource

Parameters:
Name Type Attributes Description
urlOrOptions String | Object

the url to request, or an object of DELETE args

options Object <optional>

optional settings for the DELETE operation

Properties
Name Type Attributes Description
authUrl String <optional>

url that grants a cookie

Returns:
Type
Promise

get(urlOrOptions, optionsopt) → {Promise}

Send a GET request to a resource (result must be application/json)

Parameters:
Name Type Attributes Description
urlOrOptions String | Object

the url to request, or an object of GET args

options Object <optional>

optional settings for the GET operation

Properties
Name Type Attributes Description
authUrl String <optional>

url that grants a cookie

Returns:
Type
Promise

Send a HEAD request to a resource

Parameters:
Name Type Attributes Description
urlOrOptions String | Object

the url to request, or an object of HEAD args

options Object <optional>

optional settings for the HEAD operation

Properties
Name Type Attributes Description
authUrl String <optional>

url that grants a cookie

Returns:
Type
Promise

patch(urlOrOptions, optionsopt) → {Promise}

Send a PATCH request to a resource with payload

Parameters:
Name Type Attributes Description
urlOrOptions String | Object

the url to request, or an object of PATCH args

options Object <optional>

optional settings for the PATCH operation

Properties
Name Type Attributes Description
authUrl String <optional>

url that grants a cookie

Returns:
Type
Promise

post(urlOrOptions, optionsopt) → {Promise}

Send a POST request to a resource with payload

Parameters:
Name Type Attributes Description
urlOrOptions String | Object

the url to request, or an object of POST args

options Object <optional>

optional settings for the POST operation

Properties
Name Type Attributes Description
authUrl String <optional>

url that grants a cookie

Returns:
Type
Promise

put(urlOrOptions, optionsopt) → {Promise}

Send a PUT request to a resource with payload

Parameters:
Name Type Attributes Description
urlOrOptions String | Object

the url to request, or an object of PUT args

options Object <optional>

optional settings for the PUT operation

Properties
Name Type Attributes Description
authUrl String <optional>

url that grants a cookie

Returns:
Type
Promise