Subscribe to PHP Freaks RSS

205 Reset Content

syndicated from planet-php.net on August 7, 2018

205 Reset Content is somewhat similar to 204 No Content. It’s especially meant for hypertext applications.



Imagine if a user is filling in a html form, and this form gets submitted to the server.



If the server sends back a 204, a browser could act on this by telling the user the form submission was successful and NOT refresh the page.



If the server sent back a 205, a browser can reset the form, similar to a a reset button a html form:



<input type="reset" />


Browsers could implement this, but at least according to an article from 2008 by Ben Ramsey, they don’t. Implementing this status by a HATEOAS client could definitely still make sense though.



Example response:



HTTP/1.1 205 Reset Content
Server: foo-bar/1.2
Connection: close


References