HEAD
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
HTTP HEAD
方法請求返回與使用 HTTP GET
方法請求相同 URL 時將返回的標頭。例如,如果某個 URL 可能產生大文件下載,則 HEAD
請求可以讀取其 Content-Length
標頭以檢查文件大小,而無需實際下載文件。
警告:
對 HEAD
方法的回應不應包含主體。如果它仍然包含主體,則該主體必須被忽略:任何可能描述錯誤主體的表示標頭將被假定為描述類似 GET
請求將收到的回應。
如果對 HEAD
請求的回應顯示緩存的 URL 回應現已過時,即使沒有進行 GET
請求,緩存的副本也將被使無效。
語法
http
HEAD /index.html
規範
Specification |
---|
HTTP Semantics # HEAD |
瀏覽器相容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
HEAD |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on 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.