~barry/mailman/lp1423756

« back to all changes in this revision

Viewing changes to src/mailman/rest/docs/basic.rst

  • Committer: Barry Warsaw
  • Date: 2015-01-05 01:20:33 UTC
  • mfrom: (7264.4.66 py3)
  • Revision ID: barry@list.org-20150105012033-zdrw9c2odhpf22fz
Merge the Python 3 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
When the `Authorization` header contains the proper credentials, the request
25
25
succeeds.
26
26
 
27
 
    >>> from base64 import b64encode
28
27
    >>> from httplib2 import Http
29
 
    >>> auth = b64encode('{0}:{1}'.format(config.webservice.admin_user,
30
 
    ...                                   config.webservice.admin_pass))
31
28
    >>> headers = {
32
29
    ...     'Content-Type': 'application/x-www-form-urlencode',
33
 
    ...     'Authorization': 'Basic ' + auth,
 
30
    ...     'Authorization': 'Basic cmVzdGFkbWluOnJlc3RwYXNz',
34
31
    ...     }
35
32
    >>> url = 'http://localhost:9001/3.0/system/versions'
36
33
    >>> response, content = Http().request(url, 'GET', None, headers)