Answer the question
In order to leave comments, you need to log in
Sending request to server, CORS errors?
There is such a code, it gives errors in the console:
Cause: CORS request failed
Reason: CORS header "Access-Control-Allow-Origin" is missing
In
htaccess I tried to add Header set Access-Control-Allow-Origin: "*"
Did not help
what could be the matter?
let request = new XMLHttpRequest();
request.open('GET', 'https://currate.ru/api/?get=rates&pairs=USDRUB&key=910be200aa1e6b9b1c60917731de311c');
request.setRequestHeader('Content-type', 'application/json; charset=utf-8');
request.withCredentials = true;
request.send();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question