HTTP Keep-Alive Connections in PHP

PHP class for easy use of HTTP keep alive connections. Handles transparently close connections, keep alives with content-length, and chunked encoding.

Download

socket.php
PHP class
socket.tgz
Source code and example
socket.zip
Source code and example

Comments

how do you use this

i get errors saying my function arguemnts are invalid. Please provide some directions on how to use this class.

Misses error code when not 200

the get() method misses the status code when a HTTP code other than 200 is returned. i.e. when a "HTTP/1.1 400 Bad Request" is returned status becomes "Bad" when. I believe it should be 400.

Fixed wrong status code and added an example.

Note that this library is obsolete. PEAR now has very good libraries that are better supported and have more functions. Use HTTP_Request or HTTP_Client.