XMLHttpRequest(Ajax)无法修改header中的Cookie

前端之家收集整理的这篇文章主要介绍了XMLHttpRequest(Ajax)无法修改header中的Cookie前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在调试接口的时候发现Jquery Ajax怎么修改headers的Cookie都无法生效,于是得到了这个答案

另外还有一些也无法修改,下面是不能修改的项目的数组

var forbiddenRequestHeaders = [
    "accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"   ];

猜你在找的Ajax相关文章