I had done this:
<?php
$post_body = '{"login": "injoit", "password": "injoit"}';
$cookie_file = tempnam('/temp', 'cookie');
$ch = curl_init('remote server login here');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_body);
curl_exec($ch);
I am getting this in response : Failed to connect to "remote server url here" port 8002: Connection timed out(7)