Bird
0
0

You receive these headers from an API:

medium📝 Debug Q14 of 15
Rest API - Rate Limiting and Throttling

You receive these headers from an API:

X-RateLimit-Limit: 500
X-RateLimit-Remaining: -10
X-RateLimit-Reset: 1686007200

What is the likely problem?

AThe headers are missing the total calls made.
BThe limit is too low for the API.
CThe remaining calls cannot be negative; it's an error.
DThe reset time is in the past.
Step-by-Step Solution
Solution:
  1. Step 1: Check the X-RateLimit-Remaining value

    Remaining calls cannot be negative; it should be zero or positive.
  2. Step 2: Identify the error

    A negative remaining value indicates a bug or miscalculation in the API response.
  3. Final Answer:

    The remaining calls cannot be negative; it's an error. -> Option C
  4. Quick Check:

    Remaining calls must be ≥ 0 [OK]
Quick Trick: Remaining calls can never be negative [OK]
Common Mistakes:
  • Ignoring negative values as valid
  • Confusing reset time with remaining
  • Thinking limit is the problem

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes