我正在发送一个 GET 请求,text/plain
并且在此之前发送了 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.