时间:2019-05-07 来源:小程序工厂
//npm install request-promiseconst rp = require('request-promise');
// 云函数入口函数exports.main = async(event, context) => {
var res = await rp({method: 'get',uri: 'https:/xxxx.com',qs: {},//参数headers: {},//请求头json: true //是否json数据}).then(( body) => {
return body
}).catch(err => {return err;})
return res;
}
//npm install request-promiseconst rp = require('request-promise');怎么弄
命令 npm install request-promise