From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/http/status/204/index.html | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 files/zh-cn/web/http/status/204/index.html (limited to 'files/zh-cn/web/http/status/204') diff --git a/files/zh-cn/web/http/status/204/index.html b/files/zh-cn/web/http/status/204/index.html new file mode 100644 index 0000000000..a5606e9f31 --- /dev/null +++ b/files/zh-cn/web/http/status/204/index.html @@ -0,0 +1,47 @@ +--- +title: 204 No Content +slug: Web/HTTP/Status/204 +tags: + - '204' + - HTTP + - HTTP Status Code + - 响应状态码 + - 成功响应 +translation_of: Web/HTTP/Status/204 +--- +
{{HTTPSidebar}}
+ +

HTTP 204 No Content 成功状态响应码,表示该请求已经成功了,但是客户端客户不需要离开当前页面。默认情况下 204 响应是可缓存的。一个 {{HTTPHeader("ETag")}} 标头包含在此类响应中。 

+ +

使用惯例是,在 {{HTTPMethod("PUT")}} 请求中进行资源更新,但是不需要改变当前展示给用户的页面,那么返回 204 No Content。如果创建了资源,则返回 {{HTTPStatus("201")}} Created 。如果应将页面更改为新更新的页面,则应改用 {{HTTPStatus("200")}} 。

+ +

状态

+ +
204 No Content
+ +

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("7231", "204 No Content" , "6.3.5")}}Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
+ +

浏览器兼容性

+ + + +

{{Compat("http.status.204")}}

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf