fetch('./api/some.json') .then(response => { if (response.status !== 200) { console.log(`Looks like there was a problem. Status Code: ${response.status}`); return; } // Examine the text in the response response.json().then(function(data) { console.log(data); }); }) .catch(err => { console.log('Fetch Error :-S', err); }); The fetch() request needs only one call to do the same work as the XHR exampl