Using window.fetch and the config is:
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
mode: 'cors',
cache: 'force-cache'
and the Chrome response as following:
500 (Internal Server Error)
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 500. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on January 31, 2018 at 1:36 AM
The header is present, you can inspect it in the response.
Here's an example jQuery script that makes a request with no issues.