[Catalyst] Catalyst::Action::REST

Boris Ćeranić zextra at gmail.com
Mon Nov 20 10:55:11 GMT 2006


This sounds like a good idea & module to me. Most of the time, I find
myself doing

if ( $c->req->method eq 'POST' ) { } else { }

..which doesn't improve code readability (at last in my case).

Thanks for this addition ;)

On 20/11/06, Adam Jacob <adam at stalecoffee.org> wrote:
> After much discussion, I've unleased Catalyst::Action::REST upon an
> unsuspecting CPAN.  It's an attempt at making RESTful web applications
> in Catalyst easier (they were already pretty easy.) The basics:
>
> 1) Uses an Action class to extend Catalyst's dispatch mechanism to allow
> for different methods based on the HTTP Method.  For example:
>
> sub foo :Local :ActionClass('REST') {}
>
> sub foo_GET {}
>
> sub foo_POST {}
>
> sub foo_DELETE {}
>
> 2) Handles serializing and deserializing data based on the content type
> of the request.  Currently only YAML and Data::Dumper are implemented,
> but it's easy to add more. (XML, anyone?)
>
> 3) Wraps those parts together in a Catalyst::Controller::REST, so you
> don't have to. :)  The Controller base class also includes helper
> methods for returning the various HTTP Result Codes (and their proper
> attending headers and bodies.)
>
> The code is still pretty early in it's development.  It's working great
> for me, but there are certainly still areas for improvement.  At the
> very least, I think it's a good starting place for those of us doing
> REST app's in Catalyst to collaborate.
>
> On the CPAN:
>
> http://search.cpan.org/~holoway/Catalyst-Action-REST-0.1/
>
> If you have any questions, comments, patches, flames, or beer, you can
> usually find me as holoway on #catalyst.
>
> The all important shout-out goes to mst and jrockway, who helped more
> than considerably with the design. (But all the bugs, I assure you, are
> mine.)
>
> Adam
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list