Stream: implementers
Topic: HTTP code 404 or 405?
Ardon Toonstra (Sep 22 2020 at 09:22):
Suppose a server does not support the read interaction, but it does support search for a certain resource type. What would the returned HTTP code be of a read (GET [base]/[type]/[id]) request?
Alexander Kiel (Sep 22 2020 at 11:06):
Not supporting read if search is supported is not very RESTful, because one gets URL's which can't be resolved. But nevertheless, if the individual resources don't exist at all on the server (no read, update, delete), the 404 code is suitable. Only if the resource exists but doesn't support one special verb 405 is the right code.
Ardon Toonstra (Sep 23 2020 at 12:17):
Thanks Alexander.
Last updated: Apr 12 2022 at 19:14 UTC