XMLHttpRequest.setRequestHeader()方法不能修改以下头部信息

Sat Feb 14 01:01:43 CST 2015 1605 Web

文章摘要有些时候需要使用javascript修改http头部信息,但是查看官方文档后发现,下面这些信息不能通过javascript修改

陈祖煌在官方文档发现

Terminate these steps if header is a case-insensitive match for one of the following headers:

  • Accept-Charset

  • Accept-Encoding

  • Access-Control-Request-Headers

  • Access-Control-Request-Method

  • Connection

  • Content-Length

  • Cookie

  • Cookie2

  • Date

  • DNT

  • Expect

  • Host

  • Keep-Alive

  • Origin

  • Referer

  • TE

  • Trailer

  • Transfer-Encoding

  • Upgrade

  • User-Agent

  • Via

Javascript的XMLHttpRequest不能改Referer哦~~~


打赏
打赏

分享到: