Central code for handling connections to a RestAuth service.
An instance of this class represents a connection to a RestAuth service.
Parameters: |
|
---|
Perform a DELETE request on the connection. This method internally calls the send() function to perform service authentication.
Parameters: | |
---|---|
Returns: | The response to the request |
Return type: | |
Raises: |
|
Perform a GET request on the connection. This method takes care of escaping parameters and assembling the correct URL. This method internally calls the send() function to perform service authentication.
Parameters: |
|
---|---|
Returns: | The response to the request |
Return type: | |
Raises: |
|
Perform a POST request on the connection. This method takes care of escaping parameters and assembling the correct URL. This method internally calls the send() function to perform service authentication.
Parameters: | |
---|---|
Returns: | The response to the request |
Return type: | |
Raises: |
|
Perform a PUT request on the connection. This method takes care of escaping parameters and assembling the correct URL. This method internally calls the send() function to perform service authentication.
Parameters: | |
---|---|
Returns: | The response to the request |
Return type: | |
Raises: |
|
Send an HTTP request to the RestAuth service. This method is called by the get(), post(), put() and delete() methods. This method takes care of service authentication, encryption and sets Content-Type and Accept headers.
Parameters: |
|
---|---|
Returns: | The response to the request |
Return type: | |
Raises: |
|
Set the content type used by this connection. The default value is ‘json’, which is supported by the reference server implementation.
Parameters: | content_handler (str or content_handler) – Either a self-implemented handler, which must be a subclass of content_handler or a str, which must be one of the MIME types specified in CONTENT_HANDLERS. |
---|
Superclass for User and Group objects. The private methods of this class do nothing but prefix all request URLs with the prefix of that class (i.e. /users/).
Note
This features requires that you use python 3.2 or later.
A RestAuthConnection instance also has the property ‘context’, which is an ssl.SSLContext instance used for SSL connections. You can directly call methods on this instance if you want to set different SSL options. By default, verify_mode is set to CERT_REQUIRED.