wx.request({
enableChunked: true
})
public ResponseEntity<StreamingResponseBody> getChunkedData() {
return ResponseEntity.ok().body(out -> {
out.write("This is chunk 1".getBytes());
out.flush();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
out.write("This is chunk 2".getBytes());
out.flush();
});
}
按理来说flush了2次,onChunkReceived方法应该回调2次,实际console打印函数只执行了一次,就是全部返回了
遇到了同样问题,跟nginx配置有关,看https://blog.csdn.net/SFSDB/article/details/139689140?spm=1001.2014.3001.5501解决
请问下解决了吗,目前看跟nginx配置有关系