Modifying jQuery ajax request Connection header

Posted by Pat on Stack Overflow See other posts from Stack Overflow or by Pat
Published on 2010-06-02T04:10:53Z Indexed on 2010/06/02 4:53 UTC
Read the original article Hit count: 291

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jquery-ajax