You may find something useful in my Moriarty project: http://code.google.com/p/moriarty/
It's geared towards the Talis Platform but there is a lot of code in there that has no dependencies on the platform, e.g.: http://code.google.com/p/moriarty/source/browse/trunk/httprequest.class.php some documentation for that class here: http://code.google.com/p/moriarty/wiki/HttpRequest Ian