I am currently trying to access data from a server with the following code:
var _getTrailerData = function(url) {
return fetch(url, {mode: 'no-cors'})
.then(response => response.json())
.then(data => {
console.log("data", data);
}) ;
};
on not sending the no-cors header, i get a cors error from the server and otherwise, i get opaque data which I cannot access and I get an end of input error. So, if CORS has to be enabled on the server side,what are the benefits of adding the no cors header in the get request? Also, what other solutions should I look into?