首页 > 其他 > 详细

Refused to set unsafe header "Connection"

时间:2016-10-08 16:23:50      阅读:1866      评论:0      收藏:0      [点我收藏+]

参考 http://stackoverflow.com/questions/7210507/ajax-post-error-refused-to-set-unsafe-header-connection

使用ajax时,chrome报出异常:Refused to set unsafe header "Connection"。

xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");

在XMLHttpRequest不允许设置一些headers,他们会被浏览器自动设置。

Refused to set unsafe header "Connection"

原文:http://www.cnblogs.com/tinyking/p/5938959.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!