News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ian Selby's Blog:
Create a REST API with PHP
February 20, 2009 @ 10:26:29

In this recent post to his blog Ian Selby looks at how you can create a REST API that can be used as an interface layer on top of any PHP application.

One of the latest (sort of) crazes sweeping the net is APIs, more specifically those that leverage REST. It's really no surprise either, as consuming REST APIs is so incredibly easy… in any language. It's also incredibly easy to create them as you essentially use nothing more than an HTTP spec that has existed for ages.

He looks at what REST is - both the request and response sides - and some of the PHP code you can use to create your own service. His example defines all of the HTTP codes and uses a processRequest function to handle the incoming request. The response is pushed back out from the processResponse method and even includes an extension of the class to handle XML requests if they're POSTed.

0 comments voice your opinion now!
rest api tutorial xml introduction http specification


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Generating and Validating Web Forms With PEAR HTML_QuickForm

TechPortal: Custom Zend Framework Form Elements

Carsten Lucke's Blog: Introductory article on the Zend Framework for t3n magazine

PHPMaster.com: Writing a RESTful Web Service with Slim

Jonathan Snook's Blog: Elemental: Conditional Content with CakePHP


Community Events

Don't see your event here?
Let us know!


extension voicesoftheelephpant interview language series podcast version laravel symfony opinion framework library api community introduction unittest laravel5 threedevsandamaybe security release

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework