summaryrefslogtreecommitdiff
path: root/src/mailman/rest/docs/basic.rst
diff options
context:
space:
mode:
authorBarry Warsaw2017-02-06 15:30:01 +0000
committerBarry Warsaw2017-02-06 15:30:01 +0000
commit03e04a93efa312bfec58dd267959d401e9bcf22b (patch)
treedb590d461c1e9c956c1f562f826d8ba0ddf405b3 /src/mailman/rest/docs/basic.rst
parenta75a718fa9073a51df8ce4deafe8a4851818b0a7 (diff)
parent26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc (diff)
downloadmailman-03e04a93efa312bfec58dd267959d401e9bcf22b.tar.gz
mailman-03e04a93efa312bfec58dd267959d401e9bcf22b.tar.zst
mailman-03e04a93efa312bfec58dd267959d401e9bcf22b.zip
Diffstat (limited to 'src/mailman/rest/docs/basic.rst')
-rw-r--r--src/mailman/rest/docs/basic.rst15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mailman/rest/docs/basic.rst b/src/mailman/rest/docs/basic.rst
index e1a712980..1f8084ecd 100644
--- a/src/mailman/rest/docs/basic.rst
+++ b/src/mailman/rest/docs/basic.rst
@@ -9,17 +9,14 @@ credentials, and the version of the API you wish to speak to.
Credentials
===========
-When the `Authorization` header contains the proper credentials, the request
+If you include the proper basic authorization credentials, the request
succeeds.
- >>> from httplib2 import Http
- >>> headers = {
- ... 'Content-Type': 'application/x-www-form-urlencode',
- ... 'Authorization': 'Basic cmVzdGFkbWluOnJlc3RwYXNz',
- ... }
- >>> url = 'http://localhost:9001/3.0/system/versions'
- >>> response, content = Http().request(url, 'GET', None, headers)
- >>> print(response.status)
+ >>> import requests
+ >>> response = requests.get(
+ ... 'http://localhost:9001/3.0/system/versions',
+ ... auth=('restadmin', 'restpass'))
+ >>> print(response.status_code)
200