Hi guys,
I have a webservice..just say example.com. I need to do a HTTP POST to call this web service in PHP and send data to this web service. The data I'm posting is from a form so is available in variables. I have read that this might be a way to do it, but I'm not sure, so any pointers in the right direction would be appreciated.
$service_url = 'http://example.com/rest/user';
$curl = curl_init($service_url);
$curl_post_data = array(
$compName,
$package,
$email1,
$telephone1
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);