var myRequest = new Request('products.json');//GET var myRequest = new Request('products.json', {method: "post"});//POST fetch(myRequest) .then(response => response.json()) .then(data => { console.log(data); }) .catch(console.error);