There's a real nice library WebApiThrottle for API rate limiting in Web API.
As mentioned on the Wiki page, I can rate limit the API based on the authorization token header of API call.
But, how can I block the api call for the next 5 minutes if this api rate limit exceeds? Also, not that any request within next 5 minutes will reset the rate limiting exceeded time.
I checked the code but couldn't find this feature. Any other way if someone can suggest?
For the time being, I'm using this fork of WebApiThrottle and adding the dll manually to the solution. @adamriyadi has implemented this feature in the fork. Waiting for it to come to NuGet package.
Update: Later, I went with my own implementation for API rate limiting with blocking period using
HttpRuntime.Cache
. So there is no need to add any additional library.Now decorate the required API with
[ThrottleAttribute]