0
可能重複:
Why am I getting this error in python ? (httplib)爲什麼我在python中出現這個錯誤? httplib.BadStatusLine
我有一些問題,在Python代碼,我想在本地服務蟒蟒abyssws創建Web服務,但我不能接受響應..而我得到的響應時,我請求瀏覽器..
我的代碼是這樣的:
import httplib
IP = "local ip"
v_params = ""
conn = httplib.HTTPConnection(IP,8021)
conn.request("GET", v_params)
response = conn.getresponse()
data_response = response.read()
,並得到錯誤ILKE這
Traceback(most recent call last):
File "C:\Python24\lib\httplib.py", line 866, in getresponse
response.begin()
File "C:\Python24\lib\httplib.py", line 336, in begin
version, status, reason = self._read_status()
File "C:\Python24\lib\httplib.py", line 300, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine
任何建議?請幫助我嗎?
儘量不要重新發明車輪。使用['requests'](http://docs.python-requests.org/en/latest/index.html) –