DEV Community

Discussion on: 404 status code! Really?

Collapse
 
feregri_no profile image
Antonio Feregrino • Edited

Why add the burden of checking whether the response comes back with a null or not to the developer that uses your API?

501 Not Implemented or 405 Not Allowed, for endpoints that do not exist (boocs, in your case)
404 Not Found for resources that do not exist (or the user has no access to)
200 OK for succesful queries that return data

Collapse
 
mdamaceno profile image
Marco Damaceno

If the database is part of your application, go ahead with 404. If not, why to lean your app on it? It's just another perspective of how to look at the application. The RFC keeps ruling.