Re:I've been abusing HTTP Status Codes in my APIs for years
by NoGravitas on Wednesday July 13, 2022 @11:51AM
(#32084383)
Yes, and sending a 404 status code is the correct and succinct way of expressing that fact.
[ Parent
| on HN ]
Re:I've been abusing HTTP Status Codes in my APIs for years
by treis on Wednesday July 13, 2022 @12:14PM
(#32084726)
404 says you didn't find it. Not that it doesn't exist.
Re:I've been abusing HTTP Status Codes in my APIs for years
by dragonwriter on Wednesday July 13, 2022 @01:37PM
(#32086075)
> 404 says you didn’t find it. Not that it doesn’t exist.
Since a resource that does not exist cannot have any representation, it is therefore impossible for a representation to be found of such a resource. In fact, other than in the case where 421 is the correct response (“don’t ask me, I’m not responsible for that URL”) or where 406 is a more specific response than 404 (“I have the resource requested, but can’t produce a representation in the format you have requested, and don’t want to waste both of our time sending you a format you may not be able to use”), the only reason for a 404 is that the resource does not exist.