Hi Redeye,
Thank you for your reply,
I just tried with Postman Rest Client, and it works. I did pass all same parameters and headers. but when I am trying with same headers and parameters using following php code,
$url = 'http://54.154.87.175:9090/plugins/userService/users';
$headers = array("Content-Type: application/xml","Authorization: mysecret","Cache-Control:no-cache");
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_POST,true);
curl_setopt( $ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt( $ch, CURLOPT_POSTFIELDS,'<user><username>testing</username><password>1234</password> <name>Test User</name><email>test@localhost.de</email></user>');
$result = curl_exec($ch);
print curl_error($ch);
$curl_get_info=curl_getinfo($ch);
var_dump($curl_get_info);
curl_close($ch);
I am getting following response,
Failed to connect to 54.154.87.175 port 9090: Connection timed outarray(22) { ["url"]=> string(51) "http://54.154.87.175:9090/plugins/userService/users" ["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0) ["request_size"]=> int(0) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(62.367608) ["namelookup_time"]=> float(0.000222) ["connect_time"]=> float(0) ["pretransfer_time"]=> float(0) ["size_upload"]=> float(0) ["size_download"]=> float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(-1) ["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["certinfo"]=> array(0) { } ["redirect_url"]=> string(0) "" }
Can you please help, what am I doing wrong?