I am getting this error using fetch method in JavaScript
Fetch Problem: unexpected end of input
let myinit={
method:'GET',
mode:'no-cors',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Connection': 'keep-alive',
'Accept-Encoding' : 'gzip, deflate, br',
},
cache:'default'
};
let myRequest =new Request('https://opendata.ecdc.europa.eu/covid19/casedistribution/json/',myinit);
fetch(myRequest)
.then(function(response){
return response.json();
})
.then(function(data){
console.log(data);
})
.catch(function (err) {
console.log('Fetch problem: ', err.message);
});