Pick the right HTTP status code
- HTTP status codes
- beginner
- 4 min
- 2 questions
Wrong status codes make bugs invisible: a 200 with an error message hides failures from monitoring. Match each scenario to the status code a well-behaved API should return.
Skills practised: HTTP semantics, Negative testing, Bug reporting
Worked example
Deleting an order that does not exist should return 404 Not Found, not 500. A 500 suggests the server crashed instead of handling the case.
Question 1
Match each scenario to its status code.
Question 2
The API returns 200 with body {"error": "Invalid quantity"}. What should your bug report say?
0/2 answered
