From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/http/headers/content-location/index.html | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 files/zh-cn/web/http/headers/content-location/index.html (limited to 'files/zh-cn/web/http/headers/content-location') diff --git a/files/zh-cn/web/http/headers/content-location/index.html b/files/zh-cn/web/http/headers/content-location/index.html new file mode 100644 index 0000000000..6be9dba3d8 --- /dev/null +++ b/files/zh-cn/web/http/headers/content-location/index.html @@ -0,0 +1,70 @@ +--- +title: Content-Location +slug: Web/HTTP/Headers/Content-Location +tags: + - 内容协商 + - 超文本传输协议 + - 首部 +translation_of: Web/HTTP/Headers/Content-Location +--- +
{{HTTPSidebar}}
+ +

Content-Location 首部指定的是要返回的数据的地址选项。最主要的用途是用来指定要访问的资源经过内容协商后的结果的URL。

+ +

{{HTTPHeader("Location")}} 与 Content-Location是不同的,前者({{HTTPHeader("Location")}} )指定的是一个重定向请求的目的地址(或者新创建的文件的URL),而后者( Content-Location) 指向的是可供访问的资源的直接地址,不需要进行进一步的内容协商。Location 对应的是响应,而Content-Location对应的是要返回的实体。

+ + + + + + + + + + + + +
Header type{{Glossary("Entity header")}}
{{Glossary("Forbidden header name")}}no
+ +

语法

+ +
Content-Location: <url>
+
+ +

指令

+ +
+
<url>
+
相对地址(相对于要访问的URL)或绝对地址。
+
+ +

示例

+ +
Content-Location: /index.html
+ +

规范

+ + + + + + + + + + + + +
SpecificationTitle
{{RFC("7231", "Content-Location", "3.1.4.2")}}Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
+ +

浏览器兼容性

+ + + +

{{Compat("http.headers.Content-Location")}}

+ +

相关内容

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