Refused to set unsafe header "Connection"

Posted TinyKing

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Refused to set unsafe header "Connection"相关的知识,希望对你有一定的参考价值。

参考 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"的主要内容,如果未能解决你的问题,请参考以下文章

解决 Refused to display in a frame because it set ‘X-Frame-Options‘ to ‘deny‘.问题

解决 Refused to display in a frame because it set ‘X-Frame-Options‘ to ‘deny‘.问题

Django 报错 Refused to display 'http://127.0.0.1:8000/ in a frame because it set 'X-Frame-Opti

Django 报错 Refused to display 'http://127.0.0.1:8000/ in a frame because it set 'X-Frame-Opti

Cobbler安装Linux系统时报错 curl:Failed connect to 10.0.0.201:80;Connection refused

libvirt热迁移报Connection refused错误解决办法