I am trying to use the iTunes search API and the fetch api.
When I try the following I get a response the in the console.
fetch('https://api.github.com/users/bootstrap').then(function(response) {
return response.json();
}).then(function(j) {
console.log(j);
});
However when I try
fetch('https://itunes.apple.com/search?term=jack+johnson',{mode: 'no-cors'}).then(function(response) {
return response.json();
}).then(function(a) {
console.log(a);
});
I get an error Uncaught (in promise) SyntaxError: Unexpected end of input(…)
Is it possible to grab the iTunes API data in this way?
Thanks, Dave