我通过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.