title: Python get http trailers
body: <p>How do I get HTTP trailer response headers with python?  I am using <code>requests.get</code> and I am unable to get some of the X-Content-Type or X-Status.  When I use <code>curl</code> with <code>-i</code> though, I get these responses.  Do I need to send a specific header or parameter?  I tried sending <code>TE: trailers</code> but it doesnt seem to do anything.</p>
  <p>Some sample code:</p>
  <pre><code>import requests
  
  url = &quot;some_api_endpoint&quot;
  params = {&quot;param1&quot;: &quot;val1&quot;}
  headers = {&quot;Accept&quot;: &quot;application/json&quot;, &quot;TE&quot;: &quot;trailers&quot;}
  
  response = requests.get(url, params=params, headers=headers, verify=False)
  print(&quot;Status: {}&quot;.format(response.status_code))
  print(&quot;Content: {}&quot;.format(response.content.decode('utf-8')))
  print(&quot;Headers: {}&quot;.format(response.headers))
  print(&quot;Reason: {}&quot;.format(response.reason))
  </code></pre>
  <p>Output:</p>
  <pre><code>Status: 200
  Content:
  Headers: {'Connection': 'close', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked'}
  Reason: OK
  </code></pre>
  <p>curl command</p>
  <pre><code>curl -k -i &lt;url&gt;?&lt;params&gt; -H 'Accept: application/json'
  </code></pre>
  <p>Output:</p>
  <pre><code>TP/1.1 200 OK
  Connection: close
  Content-Type: application/json
  Transfer-Encoding: chunked
  
  X-Status: Some Error
  </code></pre>
  <p>I would like to get the <code>Some Error</code> or just even the header <code>X-Status</code> above from python.  Basically got the 200 from the server and while streaming some of the response, it hit an error in the middle, causing the error. Unfortunately, I cant get this message easily in python.</p>