summaryrefslogtreecommitdiff
path: root/src/mailman/rest/docs/basic.txt
blob: 79abbfde167a37039bde08a4d653c3544b3e8f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
===========
REST server
===========

Mailman exposes a REST HTTP server for administrative control.

The server listens for connections on a configurable host name and port.
Because the REST server has full administrative access, it should always be
run only on localhost, unless you really know what you're doing.  The Mailman
major and minor version numbers are in the URL.

System information can be retrieved from the server.  By default JSON is
returned.

    >>> dump_json('http://localhost:8001/3.0/system')
    http_etag: "..."
    mailman_version: GNU Mailman 3.0... (...)
    python_version: ...
    resource_type_link: http://localhost:8001/3.0/#system
    self_link: http://localhost:8001/3.0/system


Non-existent links
==================

When you try to access an admin link that doesn't exist, you get the
appropriate HTTP 404 Not Found error.

    >>> from urllib2 import urlopen
    >>> urlopen('http://localhost:8001/3.0/does-not-exist')
    Traceback (most recent call last):
    ...
    HTTPError: HTTP Error 404: Not Found