Skip to content
Myr

good readme update

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent a6ffd97 · Browse files · 1 file+52 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+52 added−3 removed

  • other:+52 added−3 removed

1 file+52 added−3 removed

modified:README.rst+52 added-3 removed
15 unmodified lines
1617Overview18--------1920This is going to be awesome. 20Existing Python modules for dealing HTTP requests are insane. I have to look up *everything* that I want to do. Most of my worst Python experiences (yes, even worse than Logging) are a result of the various built-in HTTP libraries. 2122But this one's different. This one's going to be awesome. And simple.2324Really simple.2526Usage27-----2825Hmm.. ::29Let's do this. ::3027 # something3132 >>> import requests33 >>> request.get(url, params={}, headers={} auth=None)34 >>> request.put(url, params={}, headers={}, auth=None)35 >>> request.post(url, params={}, headers={}, auth=None)36 >>> request.delete(url, params={}, headers={}, auth=None)37 38 39 >>> r = request.Request()40 41 >>> r.url = 'http://github.com'42 >>> r.add_header(('key', 'value'))43 44 >>> r.method = 'GET'45 46 >>> r.send()47 True4849 >>> dict(r)50 {51 'headers': {52 'key': 'value',53 }, 54 'response': {55 'status_code': 200,56 'headers': {57 'x-runtime': '210ms',58 'server': 'Apache 2.1',59 'Content-Type': 'text/html; charset=utf-8'60 }61 }62 }63 64Access stuff. ::6566 >>> r = request.get('https://github.com')67 >>> r.status_code()6869HTTP Authentication. ::7071 >>> whoiam = AuthObject('xxx-username', 'xxx-pass')72 >>> request.get(url, params{}, auth=whoiam)7374"Opener" System. ::7576 # all containing given url will automatically auth with given AuthObject77 >>> requests.add_autoauth(url, auth)78 798081Installation82------------8384To install tablib, simply: ::
24 unmodified lines