Re:How to (and how not to) design REST APIs
by Noishe on Wednesday November 22, 2023 @11:34PM
(#38389306)
The thing about 404, is that you can both return 404 as well as an error document that has the structure the author is looking for, which means there is no reason why you can't return a 404 status.
Got 404, returned body is json, returned body is an error object, good to go.
Oh and, by returning a 404 you help intermediate caches know that they should not cache the response.
Re:How to (and how not to) design REST APIs
by manvillej on Saturday November 25, 2023 @12:09PM
(#38414759)
without 404, how will I force my collection of funny 404 images onto the world:
https://tenor.com/view/dog-moon-moonlanding-landing-nasa-gif...
I strongly disagree with this stance as I don't think 404 is ambiguous at all. Although it would be useful to know at what point in the broader hierarchy of a specific resource requested the unavailability starts: Ultimately 404 just means the specific 'tip of the spear' resource requested is not found.