const options = {method: 'GET', headers: {Accept: 'application/json'}}; fetch('https://api.test.com/data/id', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));