擅长:python、mysql、java
<p>今天我又问了同样的问题。
我发现最简单的方法是使用<a href="https://docs.python.org/2.7/library/httplib.html?highlight=httplib#httplib.HTTPResponse" rel="nofollow">httplib</a>。在</p>
<pre><code>r = HTTPResponse(sock)
r.begin()
# now you can use HTTPResponse method to get what you want.
print r.read()
</code></pre>