Source: https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests?hl=zh-cn
const response = await fetch(url);
const reader = response.body.getReader();
// if you want to read the data as text
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
while (true) {
const { value, done } = await reader.read();
if (done) break;
console.log("Received", value); // the value is a Uint8Array
}
console.log("Response fully received");