I am using Axios version 0.19.0 to Get a JSON feed from an endpoint in a react application. I have no problem to get the feed. However, I got a problem when I try to track the download progress with the onDownloadProgress method. Below is my code:
axios.get(config.apiEndpoint, {headers: { 'key' : 'token'}, timeout: 60000,
onDownloadProgress: (progressEvent) => {
console.log(progressEvent);
}})
.then( response => {
console.log('done')
}).catch(error => {
console.log(error.message);
});
The JSON feed I needed to download was quite sizable. It took 10+ seconds to download. I expected the onDownloadProgress callback method would be triggered every few seconds until the download is completed. However, I was not quite sure why in my case the onDownloadProgressonly returned a few responses at the same time when the download was completed. Was there any setting I missing?