W
W
WebDev2017-07-17 16:45:30
HTTP headers
WebDev, 2017-07-17 16:45:30

Request for another domain?

How many have not encountered problems all the time and something does not work with these cross-domain requests.
This time the POST request to the server does not work.
I send a post request from the Client to the JS, on the server I registered everything that I found, namely:

header('Access-Control-Allow-Origin: *');
        header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token');
        header('Access-Control-Allow-Methods: GET, POST');
        header('Access-Control-Allow-Credentials: true');

Get requests work, post does not work. The error is the following:
XMLHttpRequest cannot load https://xxx.com/app/auth. 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.

What is missing? Help me please!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question