diff options
| author | Barry Warsaw | 2017-02-06 09:54:05 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2017-02-06 09:55:00 -0500 |
| commit | 26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc (patch) | |
| tree | db590d461c1e9c956c1f562f826d8ba0ddf405b3 /src/mailman/rest/docs | |
| parent | a75a718fa9073a51df8ce4deafe8a4851818b0a7 (diff) | |
| download | mailman-26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc.tar.gz mailman-26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc.tar.zst mailman-26e9f870a3d6aea1c7ff4d576d9b38e3b4d5bbbc.zip | |
Diffstat (limited to 'src/mailman/rest/docs')
| -rw-r--r-- | src/mailman/rest/docs/basic.rst | 15 |
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 |
