← Back to Chapters

HTTP 205 — Reset Content

? HTTP 205 — Reset Content

? Quick Overview

HTTP 205 Reset Content is a success status code that tells the client the request was processed successfully and that the user agent should reset the document view.

? Key Concepts

  • It is a 2xx success status code
  • Commonly used with forms and UI-based interactions
  • The response must not include a message body

? Syntax / Theory

When a server sends 205 Reset Content, the browser is expected to clear or reset input fields, UI state, or form data without reloading the page.

? Code Example

? View Code Example
// Node.js example sending 205 Reset Content
app.post('/submit', (req, res) => {
  // Process data...
  res.status(205).end();
});

? Live Output / Explanation

The browser receives a successful response and resets the current form or UI state. No content is rendered because the response body must be empty.

? Interactive Example

Type something below and click submit to simulate a server sending a 205 status.

Waiting for user input...
? View Source Code
// HTML form reset triggered by server response
fetch("/submit", { method: "POST" })
  .then(response => {
    if (response.status === 205) {
      document.getElementById("myForm").reset();
    }
  });

? Use Cases

  • Clearing form fields after successful submission
  • Resetting SPA UI state
  • Preventing page reloads after POST requests

✅ Tips & Best Practices

  • Do not send a response body with status 205
  • Use it only when a UI reset is expected
  • Prefer 204 if no UI reset is required

? Try It Yourself

  • Create a form that resets after submission
  • Test behavior in different browsers
  • Compare 204 vs 205 responses