API Testing · Junior · Question 14 of 75
What should GET /users/999 return if the user doesn't exist?
- 1
200 OKwith an empty object - 2
500 Internal Server Error - 3
404 Not Found
Show the answer
Correct answer: 404 Not Found
Explanation
A missing resource is 404. Returning 200 with {} hides the problem from clients and makes errors hard to detect.