Improve documentation of netrc authentication
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 19 Jul 2013 08:22:11 +0000 (17:22 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 19 Jul 2013 08:30:54 +0000 (17:30 +0900)
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

index 66bc3ca24314f071fa2527740f7caa7e6c1136bc..5615a6c1b75785d332cc92a40d44e2cb9f89d54f 100644 (file)
@@ -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
 --------------------