Hi I try to get data from https://swapi.dev/api/ but i recive error in console: 'Access to fetch at 'https://swapi.dev/api/people' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.'
I'm doing this in that way:
fetch('https://swapi.dev/api/people',{
headers: {
"Access-Control-Allow-Origin": '*'
}
})
.then(res=>console.log(res))
I noticed, that on incognito everything is working fine