问题描述:用 wx.request 请求一个后端的 fastAPI streamingResponse 类型的接口,PC 预览报错:{cookies: [], statusCode: "<NaN>", errMsg: "request:ok"}, 手机端直接无反应,success 不执行,fail 不执行,complete 不执行,onChunkReceived 也不执行。
问题代码:
const request_url = 'https://chat.aichat.vin/test_fake_stream';
var requestTask = wx.request({
url: request_url,
method: 'get',
data: {
query: 'hi'
},
enableChunked: true,
success: response => {
console.log('API response:');
console.log(response)
},
fail: function(error) {
console.log('Error:', error);
},
complete: function(res) {},
});
requestTask.onChunkReceived(res => {
console.log("onChunkReceived:")
console.log(res, res.data)
});
请问这是什么原因?如何解决?
你好,麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点
PC端不支持,我也在找解决办法https://developers.weixin.qq.com/community/develop/doc/000a4ebc3080e8b9f38fa84fa51400?highLine=onChunkReceived