205 Reset Content
The server fulfilled the request and instructs the client to reset the document view that caused the request.
Quick Reference
| Category | 2xx Success |
|---|---|
| RFC | RFC 9110, Section 15.3.6 |
| Has body | No — response MUST NOT include a message body |
| Cacheable | No |
| Typical use | Form submission where the form should clear after success |
What 205 Reset Content Means
HTTP 205 Reset Content signals that the server successfully processed the request and that the client should reset the user interface element that submitted the request. In practice, for a form submission, this means clear the form fields so the user can enter new data immediately.
RFC 9110 defines the intent clearly: the response is directed at resetting the “document view” that caused the request, returning it to a state that allows the user to initiate another action. This is distinct from 204 No Content, which means “success, stay where you are and do nothing.” 205 means “success, and actively reset the relevant UI component.”
Like 204, a 205 response MUST NOT include a message body. The response consists of headers only. Any body content sent after the headers should be discarded by the client.
Browser Behavior
The HTML specification describes 205 as a trigger to reset the form that submitted the request. When a browser form submits via a standard HTML form submission (not AJAX) and receives 205:
- The form fields are cleared to their default values (empty text inputs, deselected checkboxes, etc.)
- The page does not navigate — the current URL stays the same
- No body is rendered (because 205 has no body)
This behavior is documented in the HTML living standard but browser support has been inconsistent historically. Chrome and Firefox do reset forms on 205 for standard form submissions. However, the behavior is rarely relied upon in production applications because AJAX-based form handling gives developers direct control over form state.
For AJAX submissions, the browser does not automatically reset anything on a 205. The JavaScript code must handle the reset explicitly. The 205 status code is a semantic signal that the developer can act on:
const res = await fetch('/api/comments', {
method: 'POST',
body: new FormData(form)
});
if (res.status === 205) {
form.reset(); // clear all fields
showSuccessMessage('Comment posted!');
} else if (res.status === 422) {
showValidationErrors(await res.json());
}
Practical Use Cases
Comment or feedback forms: After a user submits a comment, the form should clear so they can submit another without manually deleting their input. 205 communicates this intent to the client.
Search forms: A search tool that submits a query and receives results elsewhere (in another panel or area) may benefit from resetting the search input after each submission, ready for the next query.
Data entry forms: Point-of-sale systems, inventory entry tools, and similar applications where users submit the same form structure repeatedly benefit from automatic clearing after each successful submission.
Chat message input: After sending a chat message, the input box should clear. The server processing the message can return 205 to indicate the input should reset.
Returning 205 in Common Frameworks
Express.js
app.post('/api/comments', async (req, res) => {
await Comment.create({
text: req.body.text,
userId: req.user.id
});
res.sendStatus(205); // signals: reset the form
});
Django
from django.http import HttpResponse
def submit_comment(request):
if request.method == 'POST':
Comment.objects.create(
text=request.POST['text'],
user=request.user
)
return HttpResponse(status=205) # reset the form
FastAPI
from fastapi import Response
@app.post("/comments", status_code=205)
async def create_comment(comment: CommentSchema, response: Response):
await db.comments.insert(comment.dict())
# Return None with 205 — reset the form
Choosing Between 200, 204, and 205
The choice between these three 2xx codes for a successful POST or PUT comes down to what the client should do after the request:
- 200 OK — Use when you have a meaningful response body to return (the created/updated resource, a confirmation payload, etc.)
- 204 No Content — Use when success needs no response body and no UI reset: silent background saves, DELETE operations, heartbeat pings.
- 205 Reset Content — Use when success needs no response body but the initiating UI element should be reset: entry forms meant for repeated submission.
In practice, many APIs return 200 with an empty body or a minimal confirmation object for all three cases. 204 and 205 are more semantically precise but require client-side handling of the status code. Whether the semantic precision is worth the implementation cost depends on the API contract and client sophistication.
205 vs Related Status Codes
| Code | Has body | Client action | Use when |
|---|---|---|---|
| 200 OK | Yes | Process response body | Success with data to return |
| 201 Created | Usually | Acknowledge new resource | POST creates a new resource |
| 204 No Content | No | Do nothing | Success, no UI change needed |
| 205 Reset Content | No | Reset the initiating UI | Success, form should clear for reuse |
Frequently Asked Questions
Do browsers actually reset forms on 205?
Yes, for standard HTML form submissions (not AJAX), modern browsers follow the HTML spec and reset the form on 205. For AJAX-based submissions, no automatic reset happens — the JavaScript code must call form.reset() explicitly when it sees a 205 response.
Is 205 commonly used?
No. It is one of the least-used 2xx codes in production APIs. Most teams use 200 with a response body or 204 for success-without-body scenarios, and handle form clearing entirely in JavaScript regardless of the status code. 205 is semantically correct for its intended use case but rarely seen in the wild.
Can I include a body with 205?
RFC 9110 states that 205 MUST NOT include a message body. Unlike 200, there is no option to include content. If you need to return data along with a form-reset signal, you would need to use 200 and handle the reset in JavaScript based on application logic rather than the HTTP status code.
What does “reset the document view” mean in the spec?
The RFC uses this phrase to mean: restore the user interface that generated the request to an unmodified, initial state. For a form, that means clearing filled-in fields. For a drawing canvas, that might mean clearing the canvas. The spec leaves the specific UI action to the client to determine based on the nature of the interface.