Instagram-PHP-API: Undefined index: X-Ratelimit-Remaining
Have anyone came across this issue before? I’m getting an undefined index notice and the request is not going through.
I saw this post in StackOverflow but I’m not sure how to fix the issue in relation to this library.
Notice: Undefined index: X-Ratelimit-Remaining in /Users/name/Projects/Instagram-PHP-API/src/Instagram.php on line 633
Here is the code I’m running. I just modified the success.php file a little bit
// store user access token
$instagram->setAccessToken($data);
// now you have access to all authenticated user methods
$result = $instagram->getTagMedia("#Travel");
Any help would be greatly appreciated!
Thank you, Ahmad
About this issue
- Original URL
- State: open
- Created 9 years ago
- Reactions: 4
- Comments: 17
This may or may not be the same for you but dumping the $headers variable showed that the X-RateLimit-Remaining index existed but in lowercase. Maybe a check on both should be made to get past this error.
Line 633 of Instagram.php From:
$this->_xRateLimitRemaining = $headers['X-Ratelimit-Remaining'];To$this->_xRateLimitRemaining = isset($headers['X-Ratelimit-Remaining']) ? $headers['X-Ratelimit-Remaining'] : $headers['x-ratelimit-remaining'];