admin管理员组文章数量:1415467
I'm trying to modify the Connection header with the following code with no success
jQuery.ajax({
url: URL,
async: boolVariable,
beforeSend: function(xhr)
{
xhr.setRequestHeader("Connection", "close");
}
})
The request headers via Firebug show:
Connection keep-alive
X-Requested-With XMLHttpRequest
Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?
I'm trying to modify the Connection header with the following code with no success
jQuery.ajax({
url: URL,
async: boolVariable,
beforeSend: function(xhr)
{
xhr.setRequestHeader("Connection", "close");
}
})
The request headers via Firebug show:
Connection keep-alive
X-Requested-With XMLHttpRequest
Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?
Share Improve this question edited Aug 2, 2010 at 1:16 Nick Craver 631k138 gold badges1.3k silver badges1.2k bronze badges asked Jun 2, 2010 at 4:10 PatPat 5,2821 gold badge38 silver badges53 bronze badges1 Answer
Reset to default 4According to the standard here you are not allowed to set the Connection header. It will terminate the set header. Also if you try this in webkit the console will output Refused to set unsafe header "Connection" So it looks like you will not be able to do what you want on the client side.
本文标签: javascriptModifying jQuery ajax request Connection headerStack Overflow
版权声明:本文标题:javascript - Modifying jQuery ajax request Connection header - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745211201a2647896.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论