How Is The URL String Output To the API
-
When this code is executed. What string is sent to the api…basically what is curl outputting ? I need to know the how the syntax is written for one of my solutions im developing. For Ex. https://mywebsite.com?slm_check=43565473435 <— I know this isn’t how its written but just to give you an example of what i mean. Appreciate your help.
<?php
/*** Mandatory data ***/
// Post URL
$postURL = “https://mywebsite.com”;
// The Secret key
$secretKey = “43565473435”;/*** Optional Data ***/
//$firstname = “John”;
//$lastname = “Doe”;
//$email = “[email protected]”;// prepare the data
$data = array ();
$data[‘secret_key’] = $secretKey;
$data[‘slm_action’] = ‘slm_check’;
$data [‘license_key’] = ’57f6b61dd31a2′;// send data to post URL
$ch = curl_init ($postURL);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returnValue = curl_exec ($ch);
// Process the return values
print_r($returnValue);
?>
- The topic ‘How Is The URL String Output To the API’ is closed to new replies.