title: Set Connection:Keep alive using mechanize in python
body: <p>I am trying a send a HTTP header which should contain</p>
  
  <pre><code>Connection:keep-alive
  </code></pre>
  
  <p>but when i add headers using:</p>
  
  <pre><code>br = mechanize.Browser()
  br.addheaders[('Connection','keep-alive')'''and some other headers''']
  </code></pre>
  
  <p>and send the request and analyse the sent header using Fiddler4, i get the connection status:</p>
  
  <pre><code>Connection:'close'
  </code></pre>
  
  <p>how can i manage to keep the session alive</p>
  
  <p>this is the header i am trying to send with python mechanize, which results in a </p>
  
  <p>HTTPError: HTTP Error 408: Request Timed Out</p>
  
  <pre><code>POST http://site21.way2sms.com/smstoss.action HTTP/1.1
  Origin: http://site21.way2sms.com
  Content-Length: 94
  Accept-Language: en-US,en;q=0.8
  Accept-Encoding: gzip, deflate
  Connection: close
  Accept:      text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Upgrade-Insecure-Requests: 1
  Host: site21.way2sms.com
  Referer: http://site21.way2sms.com/sendSMS?    Token=4A0CB0CC3FD1F0EE7985FFB44E04C6B7.w814
  Cache-Control: max-age=0
  Cookie: _gat=1; JSESSIONID=A08~4A0CB0CC3FD1F0EE7985FFB44E04C6B7.w814;  _ga=GA1.2.1739915090.1432824367
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
  Content-Type: application/x-www-form-urlencoded
  
  ssaction=ss&amp;Token=4A0CB0CC3FD1F0EE7985FFB44E04C6B7.w814&amp;mobile=9765272851&amp;message=6&amp;msgLen=139
  </code></pre>
  
  <p>and this is the header sent by the browser which shows the expected results:</p>
  
  <pre><code>POST http://site21.way2sms.com/smstoss.action HTTP/1.1
  Host: site21.way2sms.com
  Connection: keep-alive
  Content-Length: 94
  Cache-Control: max-age=0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Origin: http://site21.way2sms.com
  Upgrade-Insecure-Requests: 1
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML,   like Gecko) Chrome/46.0.2490.80 Safari/537.36
  Content-Type: application/x-www-form-urlencoded
  Referer: http://site21.way2sms.com/sendSMS?   Token=877AAB22C3F0B1C3D15F71C04C8AB85C.w804
  Accept-Encoding: gzip, deflate
  Accept-Language: en-US,en;q=0.8
  Cookie: _gat=1; JSESSIONID=A04~877AAB22C3F0B1C3D15F71C04C8AB85C.w804;   _ga=GA1.2.1739915090.1432824367
  
           ssaction=ss&amp;Token=877AAB22C3F0B1C3D15F71C04C8AB85C.w804&amp;mobile=9765272851&amp;message=3&amp;msgLen=139
  </code></pre>