4 ms·
The problem with things like 404 is then you need to differentiate between "Hi, this is the application and the object/document/whatever you are looking for wa
by justinsaccount 10y ago
The problem with things like 404 is then you need to differentiate between
"Hi, this is the application and the object/document/whatever you are looking for was not found"
with
"Hi, this is the server and the api endpoint was not found"
An API I use returns a standard apache 404 error page when the item you are looking up doesn't exist. If the API endpoint was renamed my code that consumes it wouldn't have any idea anything was wrong.
- euyyn 10y agoI mean, if the API endpoint is renamed, they have broken all their clients.
- johnjuuljensen 10y agoYes, an additional 4xx code to help differentiate between api endpoints and resources would be nice. I didn't mean to imply that HTTP status codes could stand alone as error messages, so for a 404 error I'd also respond with more data, to help the user identify the issue.
- justinsaccount 10y agoYeah.. The bigger issue with this app is that it responds with a default apache 404 page instead of a 404 code + its usual xml response.
- eveningcoffee 10y agoI think that this example illustrates why parent mentioned that this is a trap.