i am using an express node server and i want to receive response in chunks at client. but i am receiving concatenated data like i have a loop a at server end and at each index i am doing res.write(index) like this
for(let index = 0; index <= 10; index+){
res.write(index)
}
but instead of getting single index at client each time i get a response it contains all previous responses concatenated as well for example for first time i get 1.for second time i get 12.third time i get 123 and so on. at client i am receiving res like this
axios.post(url, body, {
onDownloadProgress: progressEvent => {
const dataChunk = progressEvent.currentTarget.response;
//chunky response here
//here i am getting concatenated data
);
},
timeout: 600000
})
.then((response) => {
//final response here
})