I can't help with the dispatch stuff, except to snipe that Catalyst::Controller::REST might make it easy. :) As far as the REST design goes. Try to keep verbs and ranges out of URIs. I'd expect /products by itself to return "all" products or at least take a query arg to do so. PUT *is* add. So-
GET http://example.com/products/all # becomes GET http://example.com/products # or maybe something like GET http://example.com/products?rows=all # or GET http://example.com/products?from=1;to=-1 # And then PUT /etc/passwd http://example.com/products/add # becomes PUT /etc/passwd http://example.com/products # or maybe better PUT /etc/passwd http://example.com/product
Unless things have progressed recently, you'll also have to "overload" POST to do the "PUT" work since PUT isn't universally supported.
In reply to Re: Struggling to understand making CGI::Application RESTFUL
by Your Mother
in thread Struggling to understand making CGI::Application RESTFUL
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |