本實例只是簡單記錄http請求
1,雲函數如下
// 雲函數入口函數 exports.main = async (event, context) => { let req = await got('http://xxx:9090/xxx/xxx') return req.body }
2,調用實例
wx.cloud.callFunction({ name: 'http' }).then(res => { console.info(JSON.parse(res.result).ret) }).catch(err => { })