Lets setup a virtual environment and install wheezy.core package:
virtualenv env env/bin/easy_install wheezy.coreLaunch python from virtual environment (env/bin/python) and try this:
>>> from wheezy.core.httpclient import HTTPClient >>> c = HTTPClient('http://buildbot.buildbot.net/json/') >>> c.get('project') 200 >>> project = c.json >>>> str(project.title) BuildbotHere is another example that demonstarates etag handling (the second time we request events the server responds with HTTP status code 304, not modified):
>>> base = 'https://api.github.com/repos/python/cpython/' >>> c = HTTPClient(base) >>> c.get('events') 200 >>> c.headers['content-encoding'] ['gzip'] >>> c.get('events') 304The HTTPClient supports HTTP(S) GET/HEAD/POST verbs, follows redirects, handles cookies and etags between requests, gzip content decoding.