let url = 'http://localhost:8000'; let http = new XMLHttpRequest(); http.open('GET', url); http.send(); http.onreadystatechange = () => { if (http.readyState === XMLHttpRequest.DONE) { if(http.status === 200) { let data = JSON.parse(http.responseText); console.log(data.products.items); } } }