Skip to main content
Tweeted twitter.com/StackProgrammer/status/728841311437099008
Question Protected by gnat
I have added http-response in order to give to the question a wide scope. Also because it's related to http protocol's responses.
Link
Source Link
mpmp
  • 841
  • 3
  • 9
  • 12

Proper RESTful web service response code usage

Assuming I create a RESTful web service that looks up a user in a database given the id as a parameter.

If the user does not exist, should I return a 404 response (because user not found)? Or a 200 response with a "User not found" error message?

What's the better practice?