HTTP POST to a REST Service through PHP

reveal

New Member
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. \[code\]$service_url = 'http://example.com/rest/user';$curl = curl_init($service_url);$curl_post_data = http://stackoverflow.com/questions/3785310/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);\[/code\]
 
Back
Top