4 ms·
Reading the spec, that's definitely not what 204 is meant for. https://httpwg.org/specs/rfc7231.html#rfc.section.6.3.5 https://httpwg.org/specs/rfc7231.html#rf
by heeton 4y ago
Reading the spec, that's definitely not what 204 is meant for.
https://httpwg.org/specs/rfc7231.html#rfc.section.6.3.5 https://httpwg.org/specs/rfc7231.html#rfc.section.6.3.5
> The 204 (No Content) status code indicates that the server has successfully fulfilled the request and that there is no additional content to send in the response payload body.
I don't see how that could be intepreted to mean "You have requested a resource which does not exist". It's intended for use cases like "Your request to save the file has been received, no further content will be sent".
Or am I misreading the spec?
- innocenat 4y agoI don't know if it's still true, but back in the day returning 204 would mean the browser page won't refresh. It was one of the way to send data to server without page reloading. Sending 204 with body definitely break the spec.