diff options
Diffstat (limited to 'src/mailman/rest/docs/basic.rst')
| -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 |
