From 8f8dbec0d5a48ab39350a37b2c558ed95a4c8252 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 23 Oct 2011 14:59:46 -0400 Subject: [PATCH] docs for basic/digest auth --- docs/user/quickstart.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 7ec7593..3adfb7a 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -136,3 +136,32 @@ parameter:: >>> r = requests.get(url, cookies=cookies) >>> r.content '{"cookies": {"cookies_are": "working"}}' + + +Basic Authentication +-------------------- + +Most web services require authentication. There many different types of +authentication, but the most common is called HTTP Basic Auth. + +Making requests with Basic Auth is easy, with Requests:: + + >>> requests.get('https://api.github.com/user', auth=('user', 'pass')) + + + +Digest Authentication +--------------------- + +Another popular form of protecting web service is Digest Authentication. + +Requests supports it!:: + + >>> url = 'http://httpbin.org/digest-auth/auth/user/pass' + >>> requests.get(url, auth=('digest', 'user', 'pass')) + + + +----------------------- + +Ready for more? Check out the advanced_ section. \ No newline at end of file -- 2.7.4