@page-libs/ajax
v1.1.8
Published
Ajax plugin for Page framework.
Downloads
19
Readme
page-ajax
Ajax plugin for Page framework. It's based on the Async Tree Pattern.
Install
npm install @page-libs/ajax
Run test
npm test
Run build
npm run build
Package is already built. So, for using in Page you just need to install it.
Examples
new ResponseFromAjaxRequest({
url: 'http://localhost:8000/',
method: 'GET'
}).call();
Usage
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
|