News for hackers. Stuff that matters.
Re:I've been abusing HTTP Status Codes in my APIs for years by treis on Wednesday July 13, 2022 @11:00AM (#32083655)
The spec says:

>The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

So when you say:

>yet the record doesn't exist, then the resource doesn't exist.

So you do have a current representation for the target resource. Namely, 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 @12:53PM (#32085369)
> So you do have a current representation for the target resource.

No.

> Namely, that it doesn’t exist.

That it isn’t a representation, it is a fact about the universe (not the resource, because existence is not a predicate) which is inconsistent with their being a representation. A resource must exist to have a representation.

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.
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.