使用 ruby 的 Twitter api 标头
主要是为了获得即时速率限制(此处进行了解释 › https://dev.twitter.com /docs/rate-limiting#feature-limiting),以便以最干净的方式调用服务:在每个请求上,都可以通过 X-FeatureRateLimit-Limit,
X-FeatureRateLimit-Remaining
和 X-FeatureRateLimit-Reset
在响应标头中发送。
可以通过调用另一个端点(https://dev.twitter.com/docs/api/1/get/account/rate_limit_status)来获取这些信息,但是,在某些时候似乎会消耗您的配额,这使得它有点无关紧要。
我的问题是,不可能知道如何读取这些特定的标题...... 可能没那么难,但是,如果有人提供帮助,谢谢。
Mainly to get instant rate limitations (explained here › https://dev.twitter.com/docs/rate-limiting#feature-limiting), in order to call the service the cleanest way possible : on every request, it is possible to get those infos via the X-FeatureRateLimit-Limit
, X-FeatureRateLimit-Remaining
and X-FeatureRateLimit-Reset
sent in the response header.
It is possible to get thse information by calling another endpoint (https://dev.twitter.com/docs/api/1/get/account/rate_limit_status), but well, at some point seems to consume your quota, wich makes it kind of irrelevant.
My problem is, impossible to get how to read those specific headers…
Might not be that hard, but, if any help by anyone, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 twitter API 包装器 来处理 http 标头本身:
you can use twitter API wrapper that handles http header itself: