Skip to main content
clarification copied into post from comments
Source Link
gnat
  • 20.9k
  • 29
  • 115
  • 295
  1. The user is the resource and if it's not there you return 404 resource not found.

The URI is the representation of the entity. That's the whole point. 404 means the server was contacted and they couldn't find a resource and it returns 404.

If you are getting a server side error, there's a whole range of errors for that in the 500 range and that is what you should be returning. You can never know why the error occurred. You just know the item you are looking for doesn't exist.

  1. The user is the resource and if it's not there you return 404 resource not found.
  1. The user is the resource and if it's not there you return 404 resource not found.

The URI is the representation of the entity. That's the whole point. 404 means the server was contacted and they couldn't find a resource and it returns 404.

If you are getting a server side error, there's a whole range of errors for that in the 500 range and that is what you should be returning. You can never know why the error occurred. You just know the item you are looking for doesn't exist.

Source Link
Fran
  • 859
  • 1
  • 6
  • 8

  1. The user is the resource and if it's not there you return 404 resource not found.