From: Richard Jones Date: Mon, 27 Aug 2012 23:36:00 +0000 (+1000) Subject: improve top-level docstring X-Git-Tag: v0.14.0~1^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4311269d77dbbfdc1fa84b79146dc8f5eea246e;p=services%2Fpython-requests.git improve top-level docstring --- diff --git a/requests/__init__.py b/requests/__init__.py index e61dda7..a5a7807 100644 --- a/requests/__init__.py +++ b/requests/__init__.py @@ -6,8 +6,35 @@ # / """ -requests -~~~~~~~~ +requests HTTP library +~~~~~~~~~~~~~~~~~~~~~ + +Requests is an HTTP library, written in Python, for human beings. Basic GET +usage: + + >>> import requests + >>> r = requests.get('http://python.org') + >>> r.status_code + 200 + >>> 'Python is a programming language' in r.content + True + +... or POST: + + >>> payload = dict(key1='value1', key2='value2') + >>> r = requests.post("http://httpbin.org/post", data=payload) + >>> print r.text + { + // ...snip... // + "form": { + "key2": "value2", + "key1": "value1" + }, + // ...snip... // + } + +The other HTTP methods are supported - see `requests.api`. Full documentation +is at . :copyright: (c) 2012 by Kenneth Reitz. :license: ISC, see LICENSE for more details.