edgarzakaryan — 2012-08-09T10:29:20-04:00 — #1
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);
ironcladservers — 2012-08-09T16:34:17-04:00 — #2
You might want to check with your hosting provider, they may be blocking the port on outbound at the firewall.
richardaskew — 2012-08-10T10:13:26-04:00 — #3
Do you get any error messages?
edgarzakaryan — 2012-08-10T15:25:39-04:00 — #4
Yes, when I'm using port, it's telling me that it couldn't connect to the host. But when I'm removing the port, it's successfully sends datas.
richardaskew — 2012-08-13T05:39:39-04:00 — #5
This, drop them a support ticket, code looks fine to me