title: python-requests: fetching the head of the response content without consuming it all
body: <p>Using python-requests and python-magic, I would like to test the mime-type of a web resource without fetching all its content (especially if this resource happens to be eg. an ogg file or a PDF file). Based on the result, I might decide to fetch it all. However calling the text method after having tested the mime-type only returns what hasn't been consumed yet. How could I test the mime-type without consuming the response content?</p>
  
  <p>Below is my current code.</p>
  
  <pre><code>import requests
  import magic
  
  
  r = requests.get("http://www.december.com/html/demo/hello.html", prefetch=False)
  mime = magic.from_buffer(r.iter_content(256).next(), mime=True)
  
  if mime == "text/html":
      print(r.text)  # I'd like r.text to give me the entire response content
  </code></pre>
  
  <p>Thanks!</p>