我試圖上傳使用put_file文件(例如,從源https://www.dropbox.com/developers/start/files#python代碼)時,該回溯。這個錯誤是什麼意思?有什麼合適的方式來處理它?httplib.BadStatusLine誤差(與Dropbox的的Python SDK使用)
Traceback (most recent call last):
File "testDRBX.py", line 30, in <module>
response = client.put_file('magnum-opus.txt', f)
File "C:\Users\hicom\AppData\Roaming\Python\Python27\site-packages\dropbox\cli
ent.py", line 149, in put_file
return RESTClient.PUT(url, file_obj, headers)
File "C:\Users\hicom\AppData\Roaming\Python\Python27\site-packages\dropbox\res
t.py", line 146, in PUT
return cls.request("PUT", url, body=body, headers=headers, raw_response=raw_
response)
File "C:\Users\hicom\AppData\Roaming\Python\Python27\site-packages\dropbox\res
t.py", line 111, in request
r = conn.getresponse()
File "C:\Python27\lib\httplib.py", line 1027, in getresponse
response.begin()
File "C:\Python27\lib\httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "C:\Python27\lib\httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
爲什麼你認爲用戶代理是問題?我嘗試了'Mozilla/5.0',它不起作用。我也試過'的Mozilla/5.0(窗口; U; Windows NT的5.1;它; RV:1.8.1.11)的Gecko/20071127火狐/ 2.0.0.11',它也不起作用。 – Albert