I am new in this cURL stuff and I really don't know what this or that thing do. I've googled some code and watch how the cURL process works, but I still don't get it. That's why I am asking here now, and I hope that someone can help me to understand this.
I have seen this code somewhere and I don't know what it does and how to write it in a code.
Required Parameters
Successful Return
The question is, how will I put it in a code? I saw a lot of the code below in doing the cURL thing.
$ch = curl_init();
//Set cURL parameters
curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "{your_api_username}:{your_api_password}");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data))
);
//Perform cURL call and set $output as returned data, please note the retuned site_name value
$output = curl_exec($ch);
curl_close($ch);
So how will I include the required parameters, Returns and the CURL example?