Hey i need to get the rate limit reset in response but its not showing up in the http response headers. I have a function that gets user followers and when it gets a 429 error i want to know what the rate limit is. How can I get the rate limit header? I am using apache_response_headers() to get the headers and rate limit is now showing up. Thanks for the help!
function userFollowers( $ch, $headers,$id){
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, “https://api.twitch.tv/helix/users/follows?to_id=$id”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “GET”);
$json = json_decode(curl_exec($ch), true);
if( isset($json[‘total’])){
$result= ($json[‘total’]);
}elseif(isset($json[‘error’])){
$result =“NAN”;
return apache_response_headers();
}else?>{
$result = “ERROR”;
}
return $result;
}//end user followers function