- 授权协议: MIT
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://code.google.com/p/httplib2/
- 软件文档: http://httplib2.googlecode.com/hg/doc/html/index.html
软件介绍
httplib2是一个使用python写的支持的非常全面的http特性的库。需要Python2.3或更高版本的运行环境,0.5.0版及其以后包含了对Python3的支持。
简单的例子:
import httplib2
h = httplib2.Http(".cache")
resp, content = h.request("http://example.org/", "GET")
认证实例:
import httplib2
h = httplib2.Http(".cache")
h.add_credentials('name', 'password')
resp, content = h.request("https://example.org/chap/2",
"PUT", body="This is text",
headers={'content-type':'text/plain'} )
缓存控制:
import httplib2
h = httplib2.Http(".cache")
resp, content = h.request("http://bitworking.org/")
...
resp, content = h.request("http://bitworking.org/",
headers={'cache-control':'no-cache'})
