You want to create a Problem Details response for a rate limit error. Which JSON object correctly follows RFC 7807 and clearly informs the client about the error?
hard📝 Application Q15 of 15
Rest API - Error Handling
You want to create a Problem Details response for a rate limit error. Which JSON object correctly follows RFC 7807 and clearly informs the client about the error?
C{"type": "https://example.com/probs/rate-limit", "title": "Rate limit exceeded", "status": 429, "detail": "You have sent too many requests in a short time.", "instance": "/api/v1/resource"}
{"type": "https://example.com/probs/rate-limit", "title": "Rate limit exceeded", "status": 429, "detail": "You have sent too many requests in a short time.", "instance": "/api/v1/resource"} includes 'type' as a URI, 'title', numeric 'status' 429, 'detail', and 'instance' fields correctly.
Step 2: Validate status code and clarity
Status 429 means Too Many Requests, matching the error. Other options have missing or wrong fields or wrong status codes.
Final Answer:
{"type": "https://example.com/probs/rate-limit", "title": "Rate limit exceeded", "status": 429, "detail": "You have sent too many requests in a short time.", "instance": "/api/v1/resource"} -> Option C
Quick Check:
Correct fields and status = {"type": "https://example.com/probs/rate-limit", "title": "Rate limit exceeded", "status": 429, "detail": "You have sent too many requests in a short time.", "instance": "/api/v1/resource"} [OK]
Quick Trick:Use URI in 'type' and correct numeric 'status' [OK]
Common Mistakes:
Using string instead of number for status
Missing 'type' or using non-URI string
Wrong HTTP status code for error
Master "Error Handling" in Rest API
9 interactive learning modes - each teaches the same concept differently