Package u1rest :: Package lib :: Module client :: Class ResourceClient
[hide private]
[frames] | no frames]

Class ResourceClient

source code

object --+    
         |    
BaseClient --+
             |
            ResourceClient

A client used to handle authenticated REST Requests.

Instance Methods [hide private]
 
__init__(self, http_host, auth, base_api_path)
Ubuntu One RESTful Client.
source code
 
process_request(self, path, method, params=None, data=None)
Process a REST request.
source code
 
_get_path(self, path)
Join the path with the API base path.
source code
 
get_resource(self, path='', params=None)
Get a Resource.
source code
 
delete_resource(self, path, params=None)
Delete a Resource.
source code
 
put_resource(self, path, data=None, params=None)
PUT a Resource.
source code

Inherited from BaseClient: get_url_from_path

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, http_host, auth, base_api_path)
(Constructor)

source code 

Ubuntu One RESTful Client.

Overrides: object.__init__
(inherited documentation)

process_request(self, path, method, params=None, data=None)

source code 

Process a REST request.

This is specifically for JSON request/responses. The data, for PUT must be serializable by JSON. The http responses must be JSON serializable as well.

_get_path(self, path)

source code 

Join the path with the API base path.

This also removes trailing slashes wish are not part of the resource.