hello, i’m getting error 443 Failed to connect when using api via curl in php.
any idea why?
$endpoint = ‘https://api.binance.com/api/v3/time/’;
try
{
$curl = curl_init();
if (FALSE === $curl)
throw new Exception('Failed to initialize request.');
curl_setopt_array($curl, array(
CURLOPT_URL => $endpoint,
CURLOPT_RETURNTRANSFER => true,
));
$response = curl_exec($curl);
if (FALSE === $response)
throw new Exception(curl_error($curl), curl_errno($curl));
$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if (200 != $http_status)
throw new Exception($response, $http_status);
curl_close($curl);