Sloth::Resource - A resource that exposed by the REST server
A Map[Str = Sloth::Representation]> of all known representations of resources.
Map[Str =
By default, this will be taken from Sloth, your main Sloth application. However, if this resource only has specific representations that differ from the rest of you application, you can override it.
A Map[MethodName = Sloth::Method>.
Map[MethodName =
A map of allowed HTTP methods on this resource, to their Sloth::Method implementation. By default you do not need to worry about specifying this attribute as Sloth will default to looking for methods below the current resource namespace (for example, Resource::Pancake would look for Resource::Pancake::GET and so on).
Resource::Pancake
Resource::Pancake::GET
$self->resource_arguments : @List
Generate a set of parameters that will be passed to methods. If your methods all require a set of common, shared objects, you can override this to provide those extra initialization arguments.
$self->handle_request($request : Sloth::Request)
Handle a request for a resource.
You will not normally need to change this method, as by default it will check if the method is allowed, if there is an available serializer, and handle all the dispatching for you.
Oliver Charles
This software is copyright (c) 2011 by Oliver Charles <sloth.cpan@ocharles.org.uk>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Sloth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sloth
CPAN shell
perl -MCPAN -e shell install Sloth
For more information on module installation, please visit the detailed CPAN module installation guide.