$ch = curl_init(); // initialize curl
curl_setopt($ch, CURLOPT_URL,"http://mobilemonitoring.compliantcampaign.com/api/user/create"); //setting url
curl_setopt($ch, CURLOPT_POST, 1);
$vars=array("name"=>"testrah","password"=>"123456"); //setting post variables
curl_setopt($ch, CURLOPT_POSTFIELDS,$vars); //Posting Fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = ['Auth: 2309usdfoasep0qu234asdf1']; // setting authentication in header
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // setting authentication in header in curl
$server_output = curl_exec ($ch); // executing curl
curl_close ($ch); // closing curl;
print $server_output ;
0 comments: