I am beginning a foray into PHP and curl, and I encountered a bit of a snag. I am using curl to make a request to an API, but it doesn't seem to do anything. The request I am trying to make is a POST request with basic auth, that I expect should return an access token. It does not seem to return anything. I'm still fairly new to curl/php, so I'm assuming I just made a silly error somewhere
Thanks in advance!
function Fire($agent, $secret, $url) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $agent . ":" . $secret);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
curl_close($curl);
echo $result;
return $result;
}