class documentation
class Connection: (source)
Known subclasses: mailmanclient.restbase.async_connection.Connection
A connection to the REST client.
Method | __init__ |
Initialize a connection to the REST API. |
Method | add |
Add a list of hooks to an existing connection object. |
Method | call |
Make a call to the Mailman REST API. |
Method | rewrite |
rewrite url component with self.baseurl prefix "scheme://netloc" |
Instance Variable | auth |
Undocumented |
Instance Variable | baseurl |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | password |
Undocumented |
Instance Variable | request |
Undocumented |
Method | _prepare |
Undocumented |
Method | _process |
Given the request parameters, pass them through the list of hooks. |
overridden in
mailmanclient.restbase.async_connection.Connection
Initialize a connection to the REST API.
Parameters | |
baseurl | The base url to access the Mailman 3 REST API. |
name | The Basic Auth user name. If given, the password must
also be given. |
password | The Basic Auth password. If given the name must
also be given. |
request | A list of callables that can receive the request parameters and return them with some changes or unchanged. |
Add a list of hooks to an existing connection object.
Parameters | |
requestList[callables] | A list of Request hook which receive the request parameters. |
overridden in
mailmanclient.restbase.async_connection.Connection
Make a call to the Mailman REST API.
Parameters | |
path:str | The url path to the resource. |
data:dict | Data to send, implies POST (default) or PUT. |
method:str | The HTTP method to call. Defaults to GET when data
is None or POST if data is given. |
Returns | |
None , list , dict | The response content, which will be None, a dictionary, or a list depending on the actual JSON type returned. |
Raises | |
HTTPError | when a non-2xx status code is returned. |
rewrite url component with self.baseurl prefix "scheme://netloc"
Parameters | |
url:str | the URL to rewrite |
Returns | |
str | modified URL |