请求头 header中传cookie不生效原因

时间:2020-09-17 15:17:06   收藏:0   阅读:295

寻找请求头 header中传cookie不生效原因

axios中报错:xhr.js:126 Refused to set unsafe header "Cookie"
查找到原因:w3c规定,当请求的header匹配以下不安全字符时,将被终止
Accept-Charset
Accept-Encoding
Connection
Content-Length
Cookie
Cookie2
Content-Transfer-Encoding
Date
Expect
Host
Keep-Alive
Referer
TE
Trailer
Transfer-Encoding
Upgrade
User-Agent
Via

解决方案:在本地种cookie即可

原文:https://www.cnblogs.com/qinmengjiao123-123/p/13685262.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!