Skip to content

Instantly share code, notes, and snippets.

@mrluanma
mrluanma / http_range.py
Created July 26, 2011 14:58
HTTP Range header 的用法, 也就是传说中的断点续传, Python httplib2 示例.
1. 首先验证 web server 支持断点续传:
(django13)[www@mail ~]$ curl -i http://127.0.0.1/123.txt
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 26 Jul 2011 14:41:53 GMT
Content-Type: text/plain
Content-Length: 10
Last-Modified: Tue, 26 Jul 2011 14:32:35 GMT
Connection: keep-alive