如何发送正确的http请求下载文件

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

如何发送正确的http请求下载文件

wxt1984
Hi All

import httplib
conn = httplib.HTTPConnection("http://www.sugarcane.xmublog.com:80")
conn.set_debuglevel(1)
conn.putrequest('GET','/UploadFiles/2006-8/830935836.mp3',False,True)
conn.putheader('Accept',"*/*")
conn.putheader('Connection',"close")
conn.endheaders()
rMsg = conn.getresponse()
这段代码总是返回HTTP 400错误 显示请求语法有问题,本人对http协议了解不深,望高手赐教,不胜感激

Best Regard and Thanks
 
 



女友喜欢去的好地方!所有东东吐血价 点击进入有大惊喜!
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese
Reply | Threaded
Open this post in threaded view
|

Re: 如何发送正确的http请求下载文件

wxt1984
如Hong所说..的确是http://的问题,非常感谢
 
 
 



女友喜欢去的好地方!所有东东吐血价 点击进入有大惊喜!
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese