Skip to content
Myr

docs for basic/digest auth

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent e46251b · Browse files · 1 file+29 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+29 added−0 removed

  • other:+29 added−0 removed

1 file+29 added−0 removed

modified:docs/user/quickstart.rst+29 added
134 unmodified lines
135136 >>> r = requests.get(url, cookies=cookies)137 >>> r.content138 '{"cookies": {"cookies_are": "working"}}'139140141Basic Authentication142--------------------143144Most web services require authentication. There many different types of145authentication, but the most common is called HTTP Basic Auth.146147Making requests with Basic Auth is easy, with Requests::148149 >>> requests.get('https://api.github.com/user', auth=('user', 'pass'))150 <Response [200]>151152153Digest Authentication154---------------------155156Another popular form of protecting web service is Digest Authentication.157158Requests supports it!::159160 >>> url = 'http://httpbin.org/digest-auth/auth/user/pass'161 >>> requests.get(url, auth=('digest', 'user', 'pass'))162 <Response [200]>163164165-----------------------166167Ready for more? Check out the advanced_ section.