HTTPQUERY
English

205 Reset Content

用法

205 Reset Content 状态码表示服务器希望客户端清空当前表单上的所有内容。对于可填写的表单,这一结果对应按下”清除”按钮而非”保存”按钮。

或者,服务器也可以发送 204 状态码。它表示相同的结果,同样不带消息体,但不会特别要求客户端重置表单。

示例

客户端向服务器提交 XML 数据。服务器确认数据已被接收并处理,指示录入表单进行清空。客户端允许在同一页面上进行后续录入,从而产生新的 POST 请求。

请求

POST /signup HTTP/1.1
Host: example.com
Content-Type: application/xml
Content-Length: 92

<?xml version="1.0"?>
<person>
  <name>David Smith</name>
  <country>USA</country>
</person>

响应

HTTP/1.1 205 Reset Content

代码参考

.NET

HttpStatusCode.ResetContent

Rust

http::StatusCode::RESET_CONTENT

Rails

:reset_content

Go

http.StatusResetContent

Symfony

Response::HTTP_RESET_CONTENT

Python3.5+

http.HTTPStatus.RESET_CONTENT

Java

java.net.HttpURLConnection.HTTP_RESET

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_RESET_CONTENT

Angular

@angular/common/http/HttpStatusCode.ResetContent