ral-request
v1.0.28
Published
ral request
Downloads
21
Readme
ral-request
Install
npm i ral-request -S
Usage
ral reponse like:
{
status: 0, //0 is ok other error
msg: 'ok', //status desc
data: [], success data
}
ral.request('bind_device', {
data: {
data: {}, // post body
},
headers: {
saiyalogid: logid, //http header
},
query: {
dumi_id: userInfo.dumi_uid, //url query
}
});
}).then(function() {
console.log('[avs]directives bind finish');
}).catch(function(error) {
console.log(error);
});
response data:
{
status: 0,
msg:"ok",
data: {}
}
ral.initRal
初始化ral配置, example ral.initRal(require('yog-ral'))
ral.request
resovle return data; if status !=0 reject
ral.requestJson
resolve response body(json) ignore status check
License
The MIT License