03 Mar 2011 14:09:54 UTC
- Distribution: Sloth
- Module version: 0.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (44 / 0 / 0)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (17.59KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCYCLES Oliver Charlesand 1 contributors
- Oliver Charles
- COPYRIGHT AND LICENSE
Sloth::Method - The implementation of a single HTTP method on a resource
This map defines a list of parsers that are able to parse the body of a HTTP request into a meaningful, but more importantly, common, set of input parameters.
If this is left undefined it is assumed that a body is not meant to be provided to the method, and that all necessary parameters can be derived from the URI query parameters and path parts.
A Data::TreeValidator validator.
This takes the input from query parameters, path parts, and possibly the parsed request body, and validates it. It can optionally transform the data, and will finally return a set of clean input parameters which are passed to "execute".
$self->process_request($request : Sloth::Request)
Process a Sloth::Request and possibly return a resource.
You usually won't need to override this method, as by default it does the boiler plate plumbing for you (checking the Accept header, trying to parse the body, etc). Most users will simply need to implement "execute".
Required. Classes which consume this role must implement this method.
Executes the implemented HTTP method (for example a GET or DELETE operation) and optionally returns a resource to represent back to the user. Takes an object that represents the cleaned input parameters - a combination of path arguments, query paramaters and the parsed body (if there was one).
This software is copyright (c) 2011 by Oliver Charles <email@example.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.