skip to Main Content

Javascript – Can't convert a HTTP response to JSON

I'm fetching my own API, fetch('/guidebook/api/peak-data/') .then(response => response.json()) .then(response => JSON.stringify((response))) .then(data => { console.log('Raw JSON data:', data); console.log('Type of data:', typeof data); console.log('Type of features:', typeof data.features); }) .catch(error => { console.log('Error:', error); }); The data come from…

VIEW QUESTION
Back To Top
Search