The client performs a HTTP method on a resource uri.
Apache2::REST splits the uri in fragments.
Apache2::REST builds a Apache2::REST::Handler and let it handle the root fragment
Apache2::REST then writes the response back to the client with the appropriate writer.
If the response is written as a string (which is true for defaults writers), this string is a unicode string encoded in UTF-8 bytes.
If the requested resource is terminal, it performs the requested HTTP method (if allowed).
If the requested resource is not terminal, it solves the next fragment buy building the next handler. By default, the next handler is a class one level down in the package hierachy.
Client request: GET /foo/bar
URI fragments are
This root handle is not terminal for this request, so it builds the next handler.
The next handler will be a MyApp::REST::API::foo
One more step and the terminal handler is a MyApp::REST::API::foo::bar
The method GET is called on the MyApp::REST::API::foo::bar instance.