--- title: Content-Location slug: Web/HTTP/Headers/Content-Location tags: - 内容协商 - 超文本传输协议 - 首部 translation_of: Web/HTTP/Headers/Content-Location ---
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>
Content-Location: /index.html
| Specification | Title |
|---|---|
| {{RFC("7231", "Content-Location", "3.1.4.2")}} | Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content |
{{Compat("http.headers.Content-Location")}}