Timothy Appnel wrote:
> On 1/2/07, Jaldhar H. Vyas <[EMAIL PROTECTED]> wrote:
>
>> > I like the way Catalyst::Action::REST implements its REST
>> > functionality personally.
>>
>> You mean with attributes?
>
> No, through method naming conventions such as...
>
> entry_POST
> entry_GET
> entry_PUT
>
> ...where entry is the defined runmode. If a runmode_HTTPMETHOD doesn't
> exist the dispatcher automatically returns a method is not supported
> HTTP status method.
I've been thinking a bit on how to do this. It should be trivial to implement in
Dispatch, but I want to run the syntax by everyone.
First off, I would like to allow users to be explicit or just use convention. So
you could have a rule like this:
'/app/:module/:rm' => { auto_rest => 1 }
And it would append the HTTP method name (lowercased?) to the run mode. So
'/app/module/entry' would become
Module->entry_get
Module->entry_post
Module->entry_delete
Module->entry_put
And if a method is attempted for which there is no run mode, then it would be
the normal rm-not-found thing.
Next, I'd like to allow users to be explicit in HTTP method mapping:
'/app/:module/stuff[get]' => { rm => 'get_stuff' }
Thoughts?
--
Michael Peters
Developer
Plus Three, LP
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]