I'm attempting to send a request to a RESTful server using the HTTP module in Node.js.
Due to the large response size (64 chunks, approximately 100kb), the HTTP module combines the chunks into a single string response like this:
res.setEncoding('utf8');
res.on('data', (chunk) => {
index ++;
body.push(chunk);
});
res.on('end', () => {
console.log("===> CHUNKS COUNTER: ".red+index);
}
However, despite this default behavior, the body content contains misplaced commas, such as:
}},{"ty,pe"
instead of:
}},{"type"
Can anyone offer assistance with this issue? Thank you in advance!