DEV Community

Discussion on: Javascript fetch, retry upon failure.

Collapse
 
gabrielmmsestrem profile image
Gabriel Mauricio Melgarejo Sestrem

Hi, can I add the retries to the options?

fetch(url, {
retries: 3,
retryDelay: 1000
})
.then(function(response) {
return response.json();
})
.then(function(json) {
// do something with the result
console.log(json);
});