From: Kenneth Reitz Date: Sun, 23 Oct 2011 18:59:46 +0000 (-0400) Subject: docs for basic/digest auth X-Git-Tag: v0.7.1~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f8dbec0d5a48ab39350a37b2c558ed95a4c8252;p=services%2Fpython-requests.git docs for basic/digest auth --- 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