From 49ecffb86ee1fd957980581fb990d2d27eb366f6 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 18 Jul 2014 15:15:41 +0900 Subject: [PATCH 1/4] Add authentication classes to the API document Change-Id: Ic1464f246602b809f3c29fbafd6f36b747d5d5df --- docs/api.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 5e22814a..42f7c5a0 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -44,6 +44,13 @@ Request Sessions .. autoclass:: requests.adapters.HTTPAdapter :inherited-members: +Authentication +-------------- + +.. autoclass:: requests.auth.AuthBase +.. autoclass:: requests.auth.HTTPBasicAuth +.. autoclass:: requests.auth.HTTPProxyAuth +.. autoclass:: requests.auth.HTTPDigestAuth Exceptions ~~~~~~~~~~ From c6fa5bb1cd06ab6d8206ddb4c07572c77f26b9a3 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 18 Jul 2014 15:03:29 +0900 Subject: [PATCH 2/4] Fix a couple more malformed :meth: and :class: links Change-Id: Ie38844a40ec7a483e6ce5e56077be344242bcd99 --- docs/user/authentication.rst | 2 +- docs/user/quickstart.rst | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/user/authentication.rst b/docs/user/authentication.rst index af43bd29..dd0bf2b8 100644 --- a/docs/user/authentication.rst +++ b/docs/user/authentication.rst @@ -99,7 +99,7 @@ If you can't find a good implementation of the form of authentication you want, you can implement it yourself. Requests makes it easy to add your own forms of authentication. -To do so, subclass :class:`requests.auth.AuthBase` and implement the +To do so, subclass :class:`AuthBase ` and implement the ``__call__()`` method:: >>> import requests diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 6bd82f7d..73439edc 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -32,8 +32,8 @@ timeline :: >>> r = requests.get('https://github.com/timeline.json') -Now, we have a :class:`Response` object called ``r``. We can get all the -information we need from this object. +Now, we have a :class:`Request ` object called ``r``. We can +get all the information we need from this object. Requests' simple API means that all forms of HTTP request are as obvious. For example, this is how you make an HTTP POST request:: @@ -286,8 +286,9 @@ reference:: >>> r.status_code == requests.codes.ok True -If we made a bad request (a 4XX client error or 5XX server error response), we can raise it with -:class:`Response.raise_for_status()`:: +If we made a bad request (a 4XX client error or 5XX server error response), we +can raise it with +:meth:`Response.raise_for_status() `:: >>> bad_r = requests.get('http://httpbin.org/status/404') >>> bad_r.status_code From 17852784e8026e779274366dd7b20609f0d397f7 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 18 Jul 2014 15:18:20 +0900 Subject: [PATCH 3/4] Remove redundant sentence from quickstart introduction Change-Id: Ic03aa394941367745f3148d299b5313849f77051 --- docs/user/quickstart.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 73439edc..b1fe9344 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -6,8 +6,7 @@ Quickstart .. module:: requests.models Eager to get started? This page gives a good introduction in how to get started -with Requests. This assumes you already have Requests installed. If you do not, -head over to the :ref:`Installation ` section. +with Requests. First, make sure that: From be453ba3c34466abe93f996b7de25a3b88b6fea5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 18 Jul 2014 15:19:32 +0900 Subject: [PATCH 4/4] Remove empty 'internals' page The file is empty and not linked from anywhere, resulting in a warning when building the docs. Change-Id: Ib995d094ef525496fe8b2a369e0a0c5b4c7bd2dd --- docs/dev/internals.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/dev/internals.rst diff --git a/docs/dev/internals.rst b/docs/dev/internals.rst deleted file mode 100644 index e69de29b..00000000