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.
Не можете да откриете филм или сериал? Влезте, за да го създадете.
Искате ли да го оцените или добавите към списък?
Нямате профил?
Отговор от Travis Bell
на 30 януари 2018 в 12:36 PM
The header is present, you can inspect it in the response.
Here's an example jQuery script that makes a request with no issues.