I’m working on a PHP script that needs to communicate with a service REST API interface and I have only access to socket_create(),socket_connect(),socket_write(),socket_read() and no cURL!
I need to make the requests with custom headers they use to authenticate and track my app and when sending a POST request, post data is a json encoded string (this confuses me as I use to make POST requests with key1=value1&key2=value2 like params). Can you help me find some example of GET and POST requests with custom headers and json data in case of the POST request ?
Thx for helping,
Stephane
I think it’s better for you to use the fsockopen in php http://php.net/manual/en/function.fsockopen.php otherwise you can use the TinyHttpClient Library http://henryranch.net/software/php-http-socket-client/