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).