205 Reset Content
Description
The 205 Reset Content
status code indicates that the server has successfully processed the request and the client should reset the document view that caused the request to be sent. This status code is designed specifically for scenarios where a form submission should result in clearing the form for new input.
Unlike the 204 No Content
status code, which simply indicates successful processing without returning content, the 205 Reset Content
status code explicitly instructs the client to reset the document view. This means clearing form fields, resetting selections, and returning the user interface to its initial state.
This status code is particularly useful in web applications where users might need to submit multiple similar entries in succession, such as adding multiple items to a database or submitting multiple feedback entries.
Syntax
The server responds with a 205 Reset Content
status:
Similar to 204 No Content
, a 205 Reset Content
response MUST NOT include a message body, and thus should not include Content-Length or Content-Type headers.
Examples
Form Submission Example
A client submits a form to add a new product to a catalog:
Client Request:
POST /products HTTP/1.1
Host: inventory.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 89
name=Wireless+Headphones&price=99.99&category=Electronics&sku=WH-2023-001
Server Response:
Upon receiving this response, the client's browser should clear the form fields, allowing the user to easily add another product without having to manually clear the form.
Survey Submission Example
A client submits a survey response:
Client Request:
POST /surveys/customer-satisfaction HTTP/1.1
Host: feedback.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 112
rating=5&ease_of_use=4&customer_service=5&comments=Great+product%2C+very+satisfied+with+the+service
Server Response:
After receiving this response, the client's browser should reset the survey form, allowing another survey to be filled out (perhaps by a different person using the same device).
Data Entry Application Example
A client submits a new record in a data entry application:
Client Request:
POST /records HTTP/1.1
Host: data-entry.example.org
Content-Type: application/json
Content-Length: 157
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
{
"patient_id": "PT-12345",
"visit_date": "2023-06-15",
"temperature": 37.2,
"blood_pressure": "120/80",
"notes": "Routine checkup"
}
Server Response:
The client application should clear all form fields to prepare for the next record entry.
Summary
The 205 Reset Content
status code serves a specific purpose in web applications: it confirms successful request processing while explicitly instructing the client to reset the document view. This is particularly valuable in form-based applications where users need to submit multiple entries in succession. By automatically clearing form fields and resetting the interface to its initial state, it improves user experience and efficiency in data entry scenarios. While similar to 204 No Content
in that it doesn't return a response body, the 205
status code adds the specific instruction to reset the document view.