xhr-request-tiny
v1.0.1
Published
``` /** * 使用方式: * 1.引入 * import XHRReq from "xhr-request-tiny"; * * 2.初始化 * let req = new XHRReq(); * * 3.Promis风格调用 post/get * let data = { username: 'wc', age: 18 }
Downloads
1
Readme
/**
* 使用方式:
* 1.引入
* import XHRReq from "xhr-request-tiny";
*
* 2.初始化
* let req = new XHRReq();
*
* 3.Promis风格调用 post/get
* let data = {
username: 'wc',
age: 18
}
req.post('/api/role/save', data).then(res => {
console.log('res:', res)
}).catch(err => {
console.log('err:', err)
})
req.get('/api/role/get', data).then(res => {
console.log('res:', res)
}).catch(err => {
console.log('err:', err)
})
*/