0
如何使用python將字符串作爲HTTP請求發送?是這樣的:Python - 將http請求作爲字符串發送
r = """GET /hello.htm HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.stackoverflow.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive"""
answer = send(r)
print answer # gives me the response as string
有你在谷歌搜索......充沛?那裏的例子... –
https://docs.python.org/2/library/httplib.html#examples –
http://docs.python-requests.org/en/latest/user/quickstart/ –