intercom-dotnet icon indicating copy to clipboard operation
intercom-dotnet copied to clipboard

Add Support to access Throttle Headers

Open markalanevans opened this issue 7 years ago • 3 comments

@travega @khalilovcmd so how do i get access to the headers?

X-RateLimit-Limit: Maximum number of operations allowed in the current window
X-RateLimit-Remaining: Number of operations left in the current window.
X-RateLimit-Reset: Time when rate limit window will be reset as a Unix timestamp.

markalanevans avatar Apr 13 '18 00:04 markalanevans

@markalanevans at the moment we don't have a way to access these directly, and is one of the reasons why we need to rework that side of the library. This is something we will be addressing soon, but if you have the time and bandwidth I'll be happy to review a PR on this. 👍

kmossco avatar Apr 26 '18 07:04 kmossco

+1 I was thinking these should be bubbled up in a custom exception indicating to the caller that they were "rate limited", as easy to access properties. Or at minimum as some dictionary entries like other errors are returned.

jpasichnyk avatar Dec 18 '18 00:12 jpasichnyk

In case you expose those headers, I suggest using this spec https://tools.ietf.org/html/draft-polli-ratelimit-headers-03 which is currently supported by various api gateway (kong, envoy proxy, redhat-3scale, ...) and some client libraries.

it just expresses X-RateLimit-Reset in delta-seconds instead of a timestamp: this reduces clock-skew issues and "thundering herd" problems at begin of period

ioggstream avatar Sep 01 '20 15:09 ioggstream