title: Python Requests Not Returning Same Header as Browser Request/cURL
body: <p>I'm looking to write a script that can automatically download <code>.zip</code> files from the <a href="http://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=293" rel="nofollow">Bureau of Transportation Statistics Carrier Website</a>, but I'm having trouble getting the same response headers as I can see in Chrome when I download the zip file. I'm looking to get a response header that looks like this:</p>
  
  <pre><code>HTTP/1.1 302 Object moved
  Cache-Control: private
  Content-Length: 183
  Content-Type: text/html
  Location: http://tsdata.bts.gov/103627300_T_T100_SEGMENT_ALL_CARRIER.zip
  Server: Microsoft-IIS/8.5
  X-Powered-By: ASP.NET
  Date: Thu, 21 Apr 2016 15:56:31 GMT
  </code></pre>
  
  <p>However, when calling <code>requests.post(url, data=params, headers=headers)</code> with the same information that I can see in the Chrome network inspector I am getting the following response:</p>
  
  <pre><code>&gt;&gt;&gt; res.headers
  {'Cache-Control': 'private', 'Content-Length': '262', 'Content-Type': 'text/html', 'X-Powered-By': 'ASP.NET', 'Date': 'Thu, 21 Apr 2016 20:16:26 GMT', 'Server': 'Microsoft-IIS/8.5'}
  </code></pre>
  
  <p>It's got pretty much everything except it's missing the <code>Location</code> key that I need in order to download the <code>.zip</code> file with all of the data I want. <strong>Also</strong> the <code>Content-Length</code> value is different, but I'm not sure if that's an issue. </p>
  
  <p>I think that my issue has something to do with the fact that when you click "Download" on the page it actually sends two requests that I can see in the Chrome network console. The first request is a <code>POST</code> request that yields an <code>HTTP</code> response of 302 and then has the <code>Location</code> in the response header. The second request is a <code>GET</code> request to the url specified in the <code>Location</code> value of the response header. </p>
  
  <p>Should I really be sending two requests here? Why am I not getting the same response headers using <code>requests</code> as I do in the browser? FWIW I used <code>curl -X POST -d /*my data*/</code> and got back this in my terminal:</p>
  
  <pre><code>&lt;head&gt;&lt;title&gt;Object moved&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This object may be found &lt;a HREF="http://tsdata.bts.gov/103714760_T_T100_SEGMENT_ALL_CARRIER.zip"&gt;here&lt;/a&gt;.&lt;/body&gt;
  </code></pre>
  
  <p>Really appreciate any help!</p>