title: Universal Python HTTP response decoder
body: <p>I may be poor at googling, but so far I have come up dry. Is there no such thing as a universal decoder for HTTP responses, where you give it the body and the headers, and it returns the decoded data?</p>
  
  <p>For example:</p>
  
  <pre><code>response = requests.get("...")
  body = clever_package.decode(response.body, response.headers)
  </code></pre>
  
  <p>This is using the requests package to get the data, though this isn't strictly necessary. Is there no universal decoder which takes the contentType and isBase64Encoded headers and works its magic?</p>
  
  <p>Perhaps I'm not seeing an obvious flaw in such a package, which explains why I can't find it anywhere.</p>
  
  <p>Cheers!</p>