Bird
Raised Fist0

You want to implement a rate limit error response that tells clients to retry after 2 minutes. Which is the correct HTTP response?

hard🚀 Application Q8 of Q15
Rest API - Error Handling
You want to implement a rate limit error response that tells clients to retry after 2 minutes. Which is the correct HTTP response?
AHTTP/1.1 429 Too Many Requests\nRetry-After: 2 minutes
BHTTP/1.1 429 Too Many Requests\nRetry-After: two minutes
CHTTP/1.1 429 Too Many Requests\nRetry-After: 00:02:00
DHTTP/1.1 429 Too Many Requests\nRetry-After: 120
Step-by-Step Solution
Solution:
  1. Step 1: Understand Retry-After header format

    Retry-After accepts seconds as integer or HTTP-date format, not text or time strings.
  2. Step 2: Choose correct format for 2 minutes

    2 minutes equals 120 seconds, so 'Retry-After: 120' is correct.
  3. Final Answer:

    HTTP/1.1 429 Too Many Requests\nRetry-After: 120 -> Option D
  4. Quick Check:

    Retry-After in seconds = 120 [OK]
Quick Trick: Use seconds or HTTP-date in Retry-After header [OK]
Common Mistakes:
MISTAKES
  • Using text like '2 minutes' instead of seconds
  • Using time format like 00:02:00 incorrectly
  • Writing words instead of numbers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes