擅长:python、mysql、java
<p>根据Python请求文档:</p>
<ul>
<li><a href="http://docs.python-requests.org/en/master/user/quickstart/#binary-response-content" rel="nofollow noreferrer">http://docs.python-requests.org/en/master/user/quickstart/#binary-response-content</a></li>
</ul>
<p>上面写着:</p>
<pre><code>You can also access the response body as bytes, for non-text requests:
>>> r.content
b'[{"repository":{"open_issues":0,"url":"https://github.com/...
The gzip and deflate transfer-encodings are automatically decoded for you.
</code></pre>
<p>如果请求理解编码,那么它应该已经被解压了。在</p>
<p>如果需要访问原始数据以处理不同的解压缩机制,请使用<code>r.raw</code>。在</p>
<ul>
<li><a href="http://docs.python-requests.org/en/master/user/quickstart/#raw-response-content" rel="nofollow noreferrer">http://docs.python-requests.org/en/master/user/quickstart/#raw-response-content</a></li>
</ul>