4 ms·
And how do you know the resource doesn't exist in this case? The server says it does. The point is, "resource" is an abstraction that servers may implement as
by phlakaton 3y ago
And how do you know the resource doesn't exist in this case? The server says it does.
The point is, "resource" is an abstraction that servers may implement as they wish. The only requirements, per HTTP, is that (1) it's something that can be identified with a URI (satisfied in this case), and (2) it has information associated with it that can be retrieved and/or managed via the HTTP protocol (satisfied in this case).
We might imagine that the set of resources should be finite, or strictly mapped to extant data records in our system – but these are not requirements.
- shkkmo 3y ago> We might imagine that the set of resources should be finite, or strictly mapped to extant data records in our system – but these are not requirements. Clearly they aren't requirements as I can think of many valid use cases that violate them. To me, creating an infinite number of identical aliases for a single resource is clearly wrong. The only reason to do it is either incompetence or laziness.
- cellularmitosis 3y agoWe can argue about the semantics of "wrong" all day, but the lesson here is that not following standards and conventions creates extra work for everyone downstream.
- moring 3y agoThey followed the standard though. They returned 200 for a resource that exists. Many responses here seem to be based on the misunderstanding that this is about "not following a standard is sometimes okay-ish", when it's actually about the fact that the standard does not rigorously define what a "resource" is and what it means for the resource to "exist", other than a circular definition based on status codes.
- cellularmitosis 3y agoServing an identical resource at all possible paths is no one's idea of following established conventions. That's what redirects are for.
- phlakaton 3y agoIs it an identical resource? How do you know? But let's say they are identical. Where in the HTTP spec does it say identical resources may not be served at different endpoints? Nowhere, of course. You talk about violating conventions and standards. The conventions are defined by the HTTP spec. The standard is the HTTP spec. Neither are, so far as I can tell, being violated here.