Reset Content
Production Risk
Low. However, this status code is not widely used, and modern web applications typically handle form clearing with client-side JavaScript for a better user experience.
The server has fulfilled the request and desires that the user agent reset the 'document view' which caused the request to be sent. This response is intended to support a common data entry scenario where the user receives content that is the result of posting data, and then wants to clear the form for the next entry.
- 1A user submits a form on a webpage.
- 2The server processes the form data successfully and responds with a 205 status.
- 3The browser is then expected to clear the form fields for new input.
After submitting a multi-field data entry form, the server confirms submission and instructs the browser to clear the form for the next entry.
POST /data-entry HTTP/1.1 Host: example.com Content-Type: application/x-www-form-urlencoded field1=value1&field2=value2
expected output
HTTP/1.1 205 Reset Content
Fix
Return 205 to instruct the browser to clear the active form
// Express — return 205 Reset Content after processing a form submission
app.post('/data-entry', async (req, res) => {
await db.entries.insert(req.body);
// 205 tells the browser to reset (clear) the form that made this request
res.status(205).end(); // no body allowed
});
// Client-side: handle 205 by resetting the form manually
// (browser auto-reset is not reliably implemented across all clients)
const form = document.getElementById('entryForm');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const response = await fetch('/data-entry', {
method: 'POST',
body: new FormData(form),
});
if (response.status === 205) {
form.reset(); // explicit reset is more reliable than relying on browser behaviour
}
});Why this works
205 Reset Content signals that the server processed the request and wants the client to reset its document view — typically clearing a form for the next entry. No response body is allowed. In practice, browser auto-reset on 205 is inconsistent, so the most reliable approach is to handle the 205 status in JavaScript and call form.reset() explicitly.
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev