Bird
Raised Fist0

A REST API returns this response when rate limit is exceeded:

medium📝 Debug Q14 of Q15
Rest API - Error Handling
A REST API returns this response when rate limit is exceeded:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json

{"error": "Too many requests"}
What is missing to improve client handling?
AA Retry-After header indicating when to retry
BChanging status code to 500
CAdding Authorization header
DRemoving the error message
Step-by-Step Solution
Solution:
  1. Step 1: Identify missing headers for rate limit response

    The response lacks the Retry-After header, which helps clients know when to retry.
  2. Step 2: Understand why Retry-After is important

    Without Retry-After, clients may retry too soon, causing more errors or confusion.
  3. Final Answer:

    A Retry-After header indicating when to retry -> Option A
  4. Quick Check:

    Retry-After header missing = add it [OK]
Quick Trick: Add Retry-After header to guide client retry timing [OK]
Common Mistakes:
MISTAKES
  • Changing status code to 500 which is wrong
  • Adding Authorization header unrelated to rate limit
  • Removing error message reduces clarity

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes