From 6f6a920a68d858a89cf8a7a32d6faa1f164738ff Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 19 Jul 2013 17:22:11 +0900 Subject: [PATCH 1/2] Improve documentation of netrc authentication The documentation does not make it clear that when the credentials from netrc are used, Requests authenticates with HTTP Basic Auth. I just spent ages trying to figure out why it wasn't working, and it was because although the credentials in the netrc were correct, the server actually required HTTP Digest Auth. Add a section in the authentication documentation to make it clear that HTTP Basic Auth is used. --- docs/user/authentication.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/user/authentication.rst b/docs/user/authentication.rst index 66bc3ca2..5615a6c1 100644 --- a/docs/user/authentication.rst +++ b/docs/user/authentication.rst @@ -63,6 +63,17 @@ For more information on how to OAuth flow works, please see the official `OAuth` For examples and documentation on requests-oauthlib, please see the `requests_oauthlib`_ repository on GitHub +netrc Authentication +-------------------- + +If no authentication method is given with the ``auth`` argument, Requests will +attempt to get the authentication credentials for the URL's hostname from the +user's netrc file. + +If credentials for the hostname are found, the request is sent with HTTP Basic +Auth. + + Other Authentication -------------------- From c88fd8cc9dabb40d4737f61cbbbb87555ca88a00 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 19 Jul 2013 22:37:53 +0900 Subject: [PATCH 2/2] Move netrc authentication documentation under the Basic Auth section --- docs/user/authentication.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/user/authentication.rst b/docs/user/authentication.rst index 5615a6c1..6c213eaa 100644 --- a/docs/user/authentication.rst +++ b/docs/user/authentication.rst @@ -32,6 +32,17 @@ Providing the credentials in a tuple like this is exactly the same as the ``HTTPBasicAuth`` example above. +netrc Authentication +~~~~~~~~~~~~~~~~~~~~ + +If no authentication method is given with the ``auth`` argument, Requests will +attempt to get the authentication credentials for the URL's hostname from the +user's netrc file. + +If credentials for the hostname are found, the request is sent with HTTP Basic +Auth. + + Digest Authentication --------------------- @@ -63,17 +74,6 @@ For more information on how to OAuth flow works, please see the official `OAuth` For examples and documentation on requests-oauthlib, please see the `requests_oauthlib`_ repository on GitHub -netrc Authentication --------------------- - -If no authentication method is given with the ``auth`` argument, Requests will -attempt to get the authentication credentials for the URL's hostname from the -user's netrc file. - -If credentials for the hostname are found, the request is sent with HTTP Basic -Auth. - - Other Authentication --------------------