title: How to force JQuery to make an HTTP 1.0 request and close the connection
body: <p>I'm new to jQuery and would like to make a POST request using plain HTTP 1.0 with connection close, instead of the HTTP 1.1 connections that is currently kept alive. </p>
  
  <p>Below is an is the onClick handler for the button that does the post.</p>
  
  <pre><code>$( "#certGenBtn" ).click( function( event ) {
  $.ajax({
    type: "POST",
    url: "http://localhost:9099/",
    data: { testVal : "data" },
    success: function( data ) {
                alert( "whoops" );
             },
    beforeSend: function( xhr ) {
                    xhr.setRequestHeader( "Connection", "close" );
                }
      });
  });
  </code></pre>
  
  <p>The raw output dumped on the server side is the following:</p>
  
  <pre><code>POST / HTTP/1.1
  Host: localhost:9099
  User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0
  Accept: */*
  Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3
  Accept-Encoding: gzip, deflate
  Content-Type: application/x-www-form-urlencoded; charset=UTF-8
  Referer: http://localhost/  
  Content-Length: 12
  Origin: http://localhost
  Connection: keep-alive
  Pragma: no-cache
  Cache-Control: no-cache
  
  testVal=data
  </code></pre>
  
  <p>The Connection close header is being 'ignored' and the connection remains open to the server so the very last line <code>testVal=data</code> only gets through once i reload the page (I assume this is because the connection is then closed by the browser). I assume it's something very simple and/or stupid that I'm missing but cannot see anything in the documentation.</p>