首页 > Web开发 > 详细

判断URL是否支持断点续传?

时间:2015-11-02 19:17:07      阅读:2510      评论:0      收藏:0      [点我收藏+]
#python
#xiaodeng
#判断URL是否支持断点续传?



import urllib2  
  
req = urllib2.Request(http://ftp.ubuntu.com/)  
req.add_header(Range, bytes=0-20)
res = urllib2.urlopen(req)  


print res.headers
print res.headers[Content-Type]#text/html;charset=UTF-8


#判断该URL是否支持断点续传?
#首先由长度,其次有Range便支持断点续传~~
print res.headers[Content-Length]#21
print res.headers[Content-Range]#bytes 0-20/592

‘‘‘
Date: Mon, 02 Nov 2015 10:20:42 GMT
Server: Apache
Vary: Accept-Encoding
Content-Range: bytes 0-20/592
Content-Length: 21
Connection: close
Content-Type: text/html;charset=UTF-8
    
‘‘‘  

 

判断URL是否支持断点续传?

原文:http://www.cnblogs.com/dengyg200891/p/4930976.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!