Suddenly my curl auth request to Twitch is failing. I haven’t changed anything, so I don’t know why?
PHP code:
$ch = curl_init('https://id.twitch.tv/oauth2/validate');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: OAuth ' . $keys->access_token
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true); // Required for HTTP error codes to be reported via our call to curl_error($ch)
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); //wait 5 seconds else we have a problem
$r = curl_exec($ch);
$i = curl_getinfo($ch);
if(curl_errno($ch)){ $error_msg = curl_error($ch); }
curl_close($ch);
if(isset($error_msg)){ echo "CURL ERROR<br><br>".$error_msg; die; }
I added the error and timeout handling today to try and figure it out. Error just returns with “Operation timed out after 0 milliseconds with 0 out of 0 bytes received”. I assume Twitch changed something and my request method is missing something?