4 ms·
>Define "processed"? Why? We all know what it means. >Colloquially, https://news.ycombinator.com/this/path/does/not/exist https://news.ycombinator.com/this/p
by treis 4y ago
>Define "processed"?
Why? We all know what it means.
>Colloquially, https://news.ycombinator.com/this/path/does/not/exist https://news.ycombinator.com/this/path/does/not/exist (path "/this/path/does/not/exist") "does not exist" because we're talking about the requested resource.
That path is 404 - Not found and returns "Unknown"
https://news.ycombinator.com/item?id=52081900 https://news.ycombinator.com/item?id=52081900
Returns 200 - No such item.
In 10 years when we have that many threads it will return content.
As I've said in several other places it depends what you want to tell the client. 404 if you want to tell them you didn't find the resource. 200 if you want to tell them the resource doesn't exist.
- quesera 4y agoI did not mean to hold up HN as a measure of correctness, and I suggest that it is not a good idea to do so. > 404 if you want to tell them you didn't find the resource. 200 if you want to tell them the resource doesn't exist. 404 is a client error, like all 4xx codes. The requester can correct their request. It does not indicate that the server ~"tried to find but may have overlooked" a resource, it means that the server can authoritatively state that the resource is not findable. This is essentially, "does not exist at this time". Resources that do not exist today, might exist in the future, or they might not. This is true for both /users/1000 and /some/other/path. I interpret the RFC to support my belief: 6.5.4. 404 Not Found 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. A 404 status code does not indicate whether this lack of representation is temporary or permanent; the 410 (Gone) status code is preferred over 404 if the origin server knows, presumably through some configurable means, that the condition is likely to be permanent.
- treis 4y ago>I interpret the RFC to support my belief: Impressive given that it explicitly contradicts your point: >the server can authoritatively state that the resource is not findable >origin server did not find a current representation Those two are not the same thing.
- quesera 4y agoIt does not contradict my point at all. Those two phrases do not lexically parse in identical ways, but we should not interpret the RFC to be saying the alternative of "I really tried, but boy filesystems are hard and maybe the NFS mount disappeared, and well shucks, couldn't find it! 404!".
- treis 4y agoWe should interpret the RFC as written which is that this particular server could not find the resource. That does not mean the resource is not findable by this server at a different path or by a different server at a different host.
- quesera 4y agoI really do not understand your argument. There is no defined equivalency between host1/one/path and host2/other/path, even if the resources returned could potentially be the same. There is no retry formula for a 404 at one URL that might return 200 at another URL. There is no defined meaning for the same resource at another location. HTTP 404 makes no attempt to comment on the uniqueness or commonness of a resource. No comment on whether that resource existed in the past, is expected to exist later, or in whose imagination it could conceivably exist in the future. The HTTP response simply states whether the resource was found to exist at the specified location at the time of request. Any further conclusions drawn from a 404 are speculative.