I need an alternate to <CFHTTP> (originally ColdFusion) to be ported to PHP and client side. I would image this would be easiest achieved using JavaScript, but if you know another way I am open ears.
The thing I like about CFHTTP in ColdFusion is the versatility. You can retrieve the contents of a page, you can check the response code from that page or you could just do an HTTP request (making API's a lot easier).
I would like a PHP version of this code.
I would also like a similar function available client side for making HTTP header requests and getting the contents of the page after the call is processed.
Sample usage with working info must be presented so I am not left "guessing" at how to use a potentially fantastic system.
## Deliverables
This must be compatible with PHP 4.x and 5.x and the anticipated 6.x. I would imagine this could be achieved using cURL, but it is your choice. DO NOT use fopen() because this will be across servers. Some of which will not be mine, so I will not have access to allow certain security features.
Javascript must have the proper checks in place to make it as compatible as possible.
It would be a bonus if these codes were written in function form (meaning their actual functions, like httpRequest('URL TO SITE');
The code must also be documented as so I may change it in the future without making the whole system fail