正在发送OPTIONS请求而不是GET

时间:2016-12-22 12:19:05

标签: http http-options-method

我通过text/plain发送GET请求,然后在此之前发送OPTIONS请求。为什么会这样?

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

这是我发送它的方式,请求:

Request Method:OPTIONS
Status Code:200 OK

错误是:

Request header field partner is not allowed by Access-Control-Allow-Headers in preflight response.

0 个答案:

没有答案