Class: module:modules/http

module:modules/http()

Class representing an HTTP module.

Constructor

new module:modules/http()

Create an HTTP module.
Source:

Members

baseUrl

Get the baseUrl value.
Source:

baseUrl

Set the baseUrl value.
Source:

Methods

_fetchHttpRequest(object) → {Promise}

Provides async HTTP request with CORS supported.
Parameters:
Name Type Default Description
object Object {} the object of request params.
Properties
Name Type Default Description
method string 'GET' http method of request.
path string '/' path of http request.
formData FormData {} the form data for request body.
Source:
Returns:
A promise that resolves with the result of HTTP request.
Type
Promise

fetchDelete(object) → {Promise}

Provides async HTTP DELETE request.
Parameters:
Name Type Default Description
object Object {} the object of request params.
Properties
Name Type Default Description
path string '/' path of http request.
Source:
Returns:
A promise that resolves with the result of HTTP DELETE request.
Type
Promise

fetchGet(object) → {Promise}

Provides async HTTP GET request.
Parameters:
Name Type Default Description
object Object {} the object of request params.
Properties
Name Type Default Description
path string '/' path of http request.
Source:
Returns:
A promise that resolves with the result of HTTP GET request.
Type
Promise

fetchPatch(object) → {Promise}

Provides async HTTP PATCH request.
Parameters:
Name Type Default Description
object Object {} the object of request params.
Properties
Name Type Default Description
path string '/' path of http request.
formData FormData {} the form data for request body.
Source:
Returns:
A promise that resolves with the result of HTTP PATCH request.
Type
Promise

fetchPost(object) → {Promise}

Provides async HTTP POST request.
Parameters:
Name Type Default Description
object Object {} the object of request params.
Properties
Name Type Default Description
path string '/' path of http request.
formData FormData {} the form data for request body.
Source:
Returns:
A promise that resolves with the result of HTTP POST request.
Type
Promise

fetchPut(object) → {Promise}

Provides async HTTP PUT request.
Parameters:
Name Type Default Description
object Object {} the object of request params.
Properties
Name Type Default Description
path string '/' path of http request.
formData FormData {} the form data for request body.
Source:
Returns:
A promise that resolves with the result of HTTP PUT request.
Type
Promise