requestTask.onHeadersReceived 怎么使用
求大神帮忙:
项目需求:要监听 Response Headers 中的信息
报错:Cannot read property ‘onHeadersReceived’ of undefined
const requestTask = wx.request({ url: rootDocment + $api.home.porList, data: {}, method: 'get' , header: { 'Content-Type' : 'application/x-www-form-urlencoded' , Authorization: token }, success(res) { console.log(res.data) } }) requestTask.onHeadersReceived((res) => { console.log( 'onHeadersReceived: ' , res) console.log( '获取到了header' ) }) |
1 回复
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。