Hi everyone.
I want to send xml data using curl, and I need to put in my script port 8080.
Here is my script, but it doesn’t work, I’m thinking maybe server don’t allow me to send post to this port?
$post_url = "http://SOMEIP:8080/";
$xml_string = '<?xml version="1.0" encoding="UTF-8"?>';
$ch = curl_init($post_url);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_PORT , 8080);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "xmldata=".$xml_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$data = curl_exec($ch);
// to get information on the curl resultset
$info = curl_getinfo($ch);
print_r($data);
if(curl_errno($ch)){
print curl_error($ch);
}
curl_close($ch);