In reference to this previous question: Connect through HTTPS instead of HTTP
Would this be the good way to make a secure API call with HTTPS
?
public function demo(){
$Username = 'username';
$Password = 'xxxxxxxxx';
$url = 'http://api.text-connect.co.uk/api/api.php?Username='.$Username.'&Password='.$Password.'&Action=checkcredits';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
}
Should i use https
instead of http
at the $url
variable?