Content-Location
首部指定的是要返回的数据的地址选项。最主要的用途是用来指定要访问的资源经过内容协商后的结果的URL。
Location
与 Content-Location
是不同的,前者(Location
)指定的是一个重定向请求的目的地址(或者新创建的文件的URL),而后者( Content-Location
) 指向的是可供访问的资源的直接地址,不需要进行进一步的内容协商。Location 对应的是响应,而Content-Location对应的是要返回的实体。
Header type | Entity header |
---|---|
Forbidden header name | no |
语法
Content-Location: <url>
指令
- <url>
- 相对地址(相对于要访问的URL)或绝对地址。
示例
Content-Location: /index.html
规范
Specification | Title |
---|---|
RFC 7231, section 3.1.4.2: Content-Location | Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content |
浏览器兼容性
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.