API Testing · Junior · Question 14 of 75

What should GET /users/999 return if the user doesn't exist?

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.

Further reading

Problem with a question

API Testing · Junior · question 14

Test yourself

Take the API Testing · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz