aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/headers/content-location
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/headers/content-location
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/http/headers/content-location')
-rw-r--r--files/zh-cn/web/http/headers/content-location/index.html70
1 files changed, 70 insertions, 0 deletions
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
+---
+<div>{{HTTPSidebar}}</div>
+
+<p><strong><code>Content-Location</code></strong> 首部指定的是要返回的数据的地址选项。最主要的用途是用来指定要访问的资源经过<a href="/en-US/docs/Web/HTTP/Content_negotiation">内容协商</a>后的结果的URL。</p>
+
+<p>{{HTTPHeader("Location")}} 与 <code>Content-Location</code>是不同的,前者({{HTTPHeader("Location")}} )指定的是一个重定向请求的目的地址(或者新创建的文件的URL),而后者( <code>Content-Location</code>) 指向的是可供访问的资源的直接地址,不需要进行进一步的内容协商。Location 对应的是响应,而Content-Location对应的是要返回的实体。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">Header type</th>
+ <td>{{Glossary("Entity header")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">{{Glossary("Forbidden header name")}}</th>
+ <td>no</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">Content-Location: &lt;url&gt;
+</pre>
+
+<h2 id="指令">指令</h2>
+
+<dl>
+ <dt>&lt;url&gt;</dt>
+ <dd>相对地址(相对于要访问的URL)或绝对地址。</dd>
+</dl>
+
+<h2 id="示例">示例</h2>
+
+<pre>Content-Location: /index.html</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Title</th>
+ </tr>
+ <tr>
+ <td>{{RFC("7231", "Content-Location", "3.1.4.2")}}</td>
+ <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("http.headers.Content-Location")}}</p>
+
+<h2 id="相关内容">相关内容</h2>
+
+<ul>
+ <li>{{HTTPHeader("Location")}}</li>
+</ul>