0

I am sending a GET request via text/plain and the OPTIONS request is sent before that. Why is that so?

xmlhttp.open("GET", url, true);
xmlhttp.setRequestHeader("Content-Type", "text/plain");
xmlhttp.setRequestHeader("partner", "root");
xmlhttp.setRequestHeader("token", "token");
xmlhttp.send();

This is how I send it, the request:

Request Method:OPTIONS
Status Code:200 OK

And the error is:

Request header field partner is not allowed by Access-Control-Allow-Headers in preflight response.
lospejos
  • 1,976
  • 3
  • 19
  • 35
user99999
  • 1,994
  • 5
  • 24
  • 45

0 Answers0