Ajax plugin for Page framework. It's based on the Async Tree Pattern.
npm install @page-libs/ajax
npm test
npm run build
Package is already built. So, for using in Page you just need to install it.
new ResponseFromAjaxRequest({
url: 'http://localhost:8000/',
method: 'GET'
}).call();
const {
// Here needed async objects from the table below
} = require('@page-libs/ajax');
Async Object | Async/sync call | Parameters(default value/description) | Representation result |
---|---|---|---|
ResponseBody |
response.body, response = {statusCode, headers, body} |
response({statusCode, headers, body}) |
body |
ResponseFromAjaxRequest |
responseFromAjaxRequest | options[, requestBody] (options = {url, method, headers, mimeType, withCredentials, user, password, timeout, progressEvent, uploadProgressEvent}, requestBody) |
response({statusCode, headers, body}) |
ResponseHeaders |
response.headers, response = {statusCode, headers, body} |
response({statusCode, headers, body}) |
object |
ResponseStatusCode |
response.statusCode, response = {statusCode, headers, body} |
response({statusCode, headers, body}) |
number |