News Feed
Sections




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

Gonzalo Ayuso's Blog:
Building a simple HTTP client with PHP. A REST client
January 18, 2010 @ 10:18:20

Gonzalo Ayuso has posted a guide to creating a simple HTTP client, one that can work with REST-based interfaces.

There are several PHP libraries, even a nice PHP extension to work with CouchDB. I like Zend Framework's REST client but as exercise I will develop a HTTP client. My idea is to create a simple class that allows me to perform GET, POST and DELETE requests to a remote server.

He wants to be able to use the script in a fluent interface that would let him define the server, post and action all in one simple call. He includes the code to create a factory function he can get a new connection from, functions for each of the actions (get, post, delete) and the main function that handles all of the cURL connections (and a simple HttpExceptions class to handle any errors thrown).

0 comments voice your opinion now!
rest http client curl tutorial


blog comments powered by Disqus

Similar Posts

Anson Cheung's Blog: Create nodes in eZ Publish using PHP

Anthony Ferrara: Programming With Anthony - Prepared Statements

PHPMac.com: Building and Installing Apache 2.2.2 and PHP 5.1.3 (or 5.1.4) on Mac OS X 10.4.6

PHPBuilder.com: Using XML - Part 6: Validation

PHPBuilder.com: Import MS Access Data to MySQL 5


Community Events





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


wordpress application list bugfix release podcast install language laravel series community library code api framework configure threedevsandamaybe interview introduction developer

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