Module: ajx

Classes

CancelToken

Methods

(static) delete(url, options) → {Promise.<any>}

Send a HTTP DELETE request asynchronously.

Parameters:
Name Type Description
url string

The URL to make HTTP DELETE request.

options module:ajx.AsyncOptions

The options to make HTTP DELETE request.

Source:
Returns:

The promise object which will get fulfilled when the request completed.

Type
Promise.<any>

(static) get(url, options) → {Promise.<any>}

Send a HTTP GET request asynchronously.

Parameters:
Name Type Description
url string

The URL to make HTTP GET request.

options module:ajx.AsyncOptions

The options to make HTTP GET request.

Source:
Returns:

The promise object which will get fulfilled when the request completed.

Type
Promise.<any>

(static) isCancel(x) → {boolean}

Check whether the given object is a cancel reason.

Parameters:
Name Type Description
x any

The object to check.

Source:
Returns:

true if the object is a cancel reason.

Type
boolean

(static) patch(url, body, options) → {Promise.<any>}

Send a HTTP PATCH request asynchronously.

Parameters:
Name Type Description
url string

The URL to make HTTP PATCH request.

body any

The request body to make HTTP PATCH request. If this is null or undefined, the request body becomes empty. If this is a FormData or a HTMLFormElement, the request body becomes 'multipart/form-data'. If this is an object, the request body becomes 'application/json'. Otherwise, the request body becomes plain text.

options module:ajx.AsyncOptions

The options to make HTTP PATCH request.

Source:
Returns:

The promise object which will get fulfilled when the request completed.

Type
Promise.<any>

(static) post(url, body, options) → {Promise.<any>}

Send a HTTP POST request asynchronously.

Parameters:
Name Type Description
url string

The URL to make HTTP POST request.

body any

The request body to make HTTP POST request. If this is null or undefined, the request body becomes empty. If this is a FormData or a HTMLFormElement, the request body becomes 'multipart/form-data'. If this is an object, the request body becomes 'application/json'. Otherwise, the request body becomes plain text.

options module:ajx.AsyncOptions

The options to make HTTP POST request.

Source:
Returns:

The promise object which will get fulfilled when the request completed.

Type
Promise.<any>

(static) put(url, body, options) → {Promise.<any>}

Send a HTTP PUT request asynchronously.

Parameters:
Name Type Description
url string

The URL to make HTTP PUT request.

body any

The request body to make HTTP PUT request. If this is null or undefined, the request body becomes empty. If this is a FormData or a HTMLFormElement, the request body becomes 'multipart/form-data'. If this is an object, the request body becomes 'application/json'. Otherwise, the request body becomes plain text.

options module:ajx.AsyncOptions

The options to make HTTP PUT request.

Source:
Returns:

The promise object which will get fulfilled when the request completed.

Type
Promise.<any>

Type Definitions

AsyncOptions

Type:
  • object
Properties:
Name Type Attributes Description
headers object <optional>

The headers of the request. The keys are header names. The values are each header value.

timeout number <optional>

The timeout in milliseconds.

cancelToken module:ajx.CancelToken <optional>

The cancel token to abort the request.

Source: