Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limiting headers #201

Open
jonnymets opened this issue Dec 31, 2019 · 1 comment
Open

Rate limiting headers #201

jonnymets opened this issue Dec 31, 2019 · 1 comment

Comments

@jonnymets
Copy link

Hi all. I'm trying to ensure my code is safe when it comes to Twitter rate limiting. Twitter should be returning headers to help with this:

  • x-rate-limit-limit
  • x-rate-limit-remaining
  • x-rate-limit-reset

The code should be returning this via $tmhOAuth->response['headers'] however I'm not seeing those in there. Anybody else seeing this? There a specific way to access these I'm not seeing? Thanks for the help in advance!

@sykezz
Copy link

sykezz commented Jan 28, 2020

I'm able to see the rate limit headers. Are you getting any response from the endpoints?

$tmhOAuth->user_request([
  ...
]);
print_r($tmhOAuth->response['headers']);
...
  "HTTP/1.1 200 OK" => ""
  "status" => "200 OK"
  "strict-transport-security" => "max-age=631138519"
  "x-access-level" => "read-write-directmessages"
  "x-content-type-options" => "nosniff"
  "x-frame-options" => "SAMEORIGIN"
  "x-rate-limit-limit" => "15"
  "x-rate-limit-remaining" => "9"
  "x-rate-limit-reset" => "1580232465"
  "x-response-time" => "227"
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants