Testing Our Rate Limiter
Follow the step-by-step instructions to test the rate limiter.
We'll cover the following...
Rate limiters will limit the number of concurrent requests we can process at a given time. Let’s write a test case for the same to check whether our rate limiter works as expected.
Making our API call
First, we will create a function that can make an API call to our server. We would want to know whether the API call succeeded and whether we received a 200 response. If we received a 429 response instead, it would imply that our rate limiter had kicked in! Our function will also accept a ...