Library for performing an asynchronous HTTP (Ajax) request by using Promise
$ npm install --save t-ajax
const Ajax = require('t-ajax');
...
Ajax.post('/login', data)
.then(function(response) {
session = response.headers['set-cookie']
Ajax.get('/sessionCheck', session)
.then(function(response) {
})
}
-
get(url)
- return response
-
get(url, session)
- return response data
-
post(url, data)
- return response