I have created a class library which having certain methods that get and post the API request to a third party (Hub-Spot) so Hub Spot API has some limitations as follows
***15 requests per second and 100 requests per 10 seconds ***
Currently due to this limitation in the C# class library (NET 6.0) while calling methods some of them throw errors due to the Hub-spot API limit being exceeded.
So how can I limit the number of requests in a certain period such that when the above limit exceeds then before calling methods some delay should perform so some methods do not throw an error?
Error - You have reached your ten secondly rolling limit
I was searching some articles related to that but they showed tutorials for web API and asp Core but not for the class library for limiting requests.