Manipulating Paths

Whilst path values are useful in telling us something about where a particular resource resides or how far the processing of a resource has progressed, it is sometimes useful to apply some kind of transformation to the path in order to produce a reference to another resource or application. Consider the simple case of redirecting a user to another resource:

First we must obtain a reference to the current resource:

this_resource = trans.get_path_without_query() # eg. "/app/resource/some-data"

We may wish to redirect the user to the main application resource; this is done by removing resource from the end of the path:

this_app = trans.update_path("..")             #     produces "/app/resource"

A complete description of this method can be found in the API documentation.