From f8e2d0e7328b74e4cc6e60edd1eecaaa1052eb96 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 23 Dec 2012 01:44:54 -0500 Subject: [PATCH] api docs --- requests/api.py | 6 ++++++ requests/models.py | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/requests/api.py b/requests/api.py index 0efac8b..4a39211 100644 --- a/requests/api.py +++ b/requests/api.py @@ -32,6 +32,12 @@ def request(method, url, **kwargs): :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided. :param stream: (optional) if ``False``, the response content will be immediately downloaded. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. + + Usage:: + + >>> import requests + >>> req = requests.request('GET', 'http://httpbin.org/get') + """ session = sessions.Session() diff --git a/requests/models.py b/requests/models.py index 2ec3373..2cf1b7b 100644 --- a/requests/models.py +++ b/requests/models.py @@ -148,6 +148,8 @@ class RequestHooksMixin(object): class Request(RequestHooksMixin): """A user-created :class:`Request ` object. + Used to prepare a :class:`PreparedRequest `, which is sent to the server. + :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. @@ -381,10 +383,8 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): class Response(object): - """The core :class:`Response ` object. All - :class:`Request ` objects contain a - :class:`response ` attribute, which is an instance - of this class. + """The :class:`Response ` object, which contains a + server's response to an HTTP request. """ def __init__(self): -- 2.7.4