doris-request
v0.1.1
Published
> Promise based XMLHttpRequest lib for the browser
Downloads
4
Readme
Doris
Promise based XMLHttpRequest lib for the browser
install
$ npm i --save-dev doris-request
Usage
import doris from 'doris-request';
doris
.get('http://achuan.me', { hello: 'world' }) // http://achuan.me?hello=world
.then(res => {
const { body, status } = res;
console.log(status); // 200
})
.catch(console.err);
doris
.create({
method: 'post',
url: 'http://achuan.me',
data: { hello: 'world' }
})
.then(res => {
const { body, status } = res;
console.log(status); // 200
})
.catch(console.err); // status 405