Funny, after my post I was thinking about this type of very thing and
just didn't get around to doing something with it. Here are my initial
thoughts so far.
Ideally there would need to be a runmode evaluator in the pre_run
method that examined the requested URL and/or PATH_INFO in addition to
the HTTP method of the request. So it would not be enough to say a
PATH_INFO value of "/article" means I can method view_article. Chances
are you would want to run a different method if a "/article" request
was received using a DELETE, POST or PUT.
I was also thinking that since different URL schemes may in use, I
was thinking a get_current_runmode method is what is needed to provide
the necessary extensibility. What ever the case, you can't presume the
runmode info would be in the path info. I often just use the PATH_INFO
like...
http://www.example.com/cgi/api.cgi/article/123
which works for with what has been proposed however some might use
mod_rewrite to make this a bit more concise and elegant like so...
http://www.example.com/article/123
BTW: query strings are considered a means of further defining a
resource, not the primary means of define one. This is an area of some
debate. Every so often some newbie ask that question on rest-discuss
and then its the same food fight all over again.
Thoughts?
--
Timothy Appnel
http://www.timaoutloud.org/
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.