in reply to Struggling to understand making CGI::Application RESTFUL
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Struggling to understand making CGI::Application RESTFUL
by derby (Abbot) on Jun 08, 2010 at 11:53 UTC | |
by Your Mother (Archbishop) on Jun 08, 2010 at 16:31 UTC | |
|
Re^2: Struggling to understand making CGI::Application RESTFUL
by Anonymous Monk on Jun 07, 2010 at 22:47 UTC |