while
while
  • 发布:2023-06-01 11:21
  • 更新:2023-10-26 13:02
  • 阅读:1252

uniapp开发的微信小程序的request开启enableChunked后,requestTask.onChunkReceived没触发

分类:uni-app
const requestTask = uni.request({  
    url: url,  
    timeout: 15000,  
    responseType: 'text',  
    method: 'GET',  
    enableChunked: true,  
    data: {},  
    success: response => {  
        // console.log(response)  
    },  
    fail: error => {}  
})  
requestTask.onHeadersReceived(function(res) {  
    // console.log(res.header);  
    console.log('rrrrrrrrrccccvice')  
});  
requestTask.onChunkReceived(function(response) {  
    console.log('rrrrrrrrrccccvice22222222222')  
})  

onHeadersReceived方法触发了,但onChunkReceived没反应,咋回事呢~,我看uniapp文档没提到onChunkReceived方法,是不能用吗

2023-06-01 11:21 负责人:无 分享
已邀请:
while

while (作者) - 为3

请求头打印的这个,是后端流式传输没成功的原因吗,我看网上说如果服务器返回的是分块数据,那么响应头中将会包含 Transfer-Encoding 字段,值为 chunked,返回用没看到这个字段

ai自由畅想

ai自由畅想 - https://ai.zjchuntou.com/

草蛋,都没人理你,老铁最后怎么解决的?

要回复问题请先登录注册