On Nov 28, 2007 4:54 PM, Rob Marscher <[EMAIL PROTECTED]> wrote:
> The webserver handles implementing most of what's required for a RESTful
> interface. So... you don't exactly need a framework. Just do the
> appropriate thing on GET/POST/PUT/DELETE requests (which you can determine
> from php's $_SERVER array).
Heh, Apache+PHP _is_ a REST framework.
Okay, I've gotten in enough trouble today. But seriously, you may not
need a library unless you're doing something fancy.
Getting the data out of PUT requests is a bit tricky... here's some code:
switch ($_SERVER['REQUEST_METHOD']) {
case 'PUT':
/* PUT data comes in on the stdin stream */
$putdata = file_get_contents("php://input");
That worked in php 5.1 on unix, not sure about other versions or platforms.
--
Chris Snyder
http://chxo.com/
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php