A collection of functions used in both server and client reference implementations.
Marshal the object obj into a string of the MIME type content_type.
This method is just intended as a shortcut for content_handler.unmarshal(). If you intend to use a handler multiple times, it is better to instantiate a specific handler directly to save dictionary lookups and object instantiations.
Warning
This method will be deprecated soon.
Parameters: |
|
---|---|
Returns: | The string representation of the object. |
Return type: | str |
Raises error.MarshalError: | |
When the handler could not marshal the object. |
|
See also: |
Warning
This code will be moved to its own submodule soon.
Check the name of a resource for some really bad characters that shouldn’t be used anywhere in RestAuth.
This filters names containing a slash (“/”) or colon (”:”) and those starting with ‘.’. It also filters control characters etc., including those from unicode.
Parameters: | name (str) – The name to validate |
---|---|
Returns: | False if the name contains any invalid characters, True otherwise. |
Return type: | bool |
Unmarshal the string raw_data into an object of type typ. The string is assumed to be of the MIME type content_type.
This method is just intended as a shortcut for content_handler.unmarshal(). If you intend to use a handler multiple times, it is better to instantiate a specific handler directly to save dictionary lookups and object instantiations.
Warning
This method will be deprecated soon.
Parameters: |
|
---|---|
Return type: | typ |
Returns: | The unmarshalled data. The object has the type specified by the I{typ} parameter. |
Raises error.UnmarshalError: | |
When the handler was unable unmarshal the object. |
|
See also: |