HTTP Headers文档、HTTP Headers各项含义、HTTP Headers详解
- 相關辅助:
- HTTP Headers查看
- IP查詢
- 文檔:
- HTTP狀態碼查询
請求頭 (Request Headers)
| Header名稱 | 說明 | 示例 |
|---|---|---|
| Accept | 告訴服務器,客戶端能夠處理的內容類型,按優先級摆列 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Accept-Charset | 告訴服務器,客戶端能夠處理的字符集類型 | Accept-Charset: utf-8, iso-8859-1;q=0.5 |
| Accept-Encoding | 告訴服務器,客戶端能夠處理的編碼编制 | Accept-Encoding: gzip, deflate, br |
| Accept-Language | 告訴服務器,客戶端能夠處理的┞穁言 | Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 |
| Authorization | 包含用于服務器驗證用戶身份的憑據 | Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== |
| Cache-Control | 指定請求和響應遵守的緩存機制 | Cache-Control: no-cache, no-store, must-revalidate |
| Connection | 节制網絡連接在當前事務完成後是不是仍然保持打開狀態 | Connection: keep-alive |
| Content-Length | 請求體的長度(字節) | Content-Length: 348 |
| Content-Type | 請求體的媒體類型 | Content-Type: application/json; charset=utf-8 |
| Cookie | 包含存储在客户真个HTTP cookie | Cookie: sessionid=abc123; csrftoken=xyz789 |
| Host | 指定服務器的域名和端口號 | Host: www.example.com:8080 |
| If-Modified-Since | 只有在指定時間後資源被点窜過才返回資源 | If-Modified-Since: Wed, 21 Oct 2015 07:28:00 GMT |
| If-None-Match | 只有在ETag不匹配的情況下才返回資源 | If-None-Match: "686897696a7c876b7e" |
| Referer | 告訴服務器請求是從哪個頁面發起的 | Referer: https://www.example.com/page.html |
| User-Agent | 用戶代办代理字符串,包含客戶端信息 | User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 |
| X-Forwarded-For | 標識通過HTTP代办代理或負載均衡编制連接到Web服務器的客戶真个原始IP地址 | X-Forwarded-For: 203.0.113.195, 70.41.3.18 |
| X-Requested-With | 標識Ajax請求,凡是值爲XMLHttpRequest | X-Requested-With: XMLHttpRequest |
響應頭 (Response Headers)
| Header名稱 | 說明 | 示例 |
|---|---|---|
| Access-Control-Allow-Origin | 唆使響應的資源是不是可以被給定的來源共享 | Access-Control-Allow-Origin: https://example.com |
| Access-Control-Allow-Methods | 指明實際請求所允許利用的HTTP编制 | Access-Control-Allow-Methods: GET, POST, PUT, DELETE |
| Cache-Control | 告訴浏覽器和其他緩存該若何緩存響應 | Cache-Control: public, max-age=3600 |
| Content-Disposition | 唆使若何顯示附加的文件 | Content-Disposition: attachment; filename="file.pdf" |
| Content-Encoding | 奉告客戶端服務器對實體消息體采取的編碼编制 | Content-Encoding: gzip |
| Content-Length | 響應體的長度(字節) | Content-Length: 1024 |
| Content-Security-Policy | 允許網站办理員节制用戶代办代理爲指定的頁面加載哪些資源 | Content-Security-Policy: default-src 'self' |
| Content-Type | 告訴客戶端實際返回的內容類型 | Content-Type: text/html; charset=utf-8 |
| Date | 消息發送的日期和時間 | Date: Wed, 21 Oct 2015 07:28:00 GMT |
| ETag | 資源的版本標識符 | ETag: "686897696a7c876b7e" |
| Expires | 響應體的過期日期和時間 | Expires: Wed, 21 Oct 2015 07:28:00 GMT |
| Last-Modified | 資源的最後点窜日期和時間 | Last-Modified: Wed, 21 Oct 2015 07:28:00 GMT |
| Location | 用于重定向,指明應該訪問的URL | Location: https://www.example.com/new-page |
| Server | 包含處理請求的源頭服務器所用到的軟件相關信息 | Server: Apache/2.4.41 (Unix) |
| Set-Cookie | 由服務器端向客戶端發送cookie | Set-Cookie: sessionId=abc123; Path=/; Secure; HttpOnly |
| Strict-Transport-Security | 奉告浏覽器只能通過HTTPS訪問當前資源 | Strict-Transport-Security: max-age=31536000 |
| Transfer-Encoding | 規定了傳輸消息體時采取的編碼编制 | Transfer-Encoding: chunked |
| Vary | 奉告缓存办事器利用哪些請求頭来决定是不是可以直接利用已缓存的响应 | Vary: Accept-Encoding, User-Agent |
| WWW-Authenticate | 定義了利用何種驗證编制去獲取對資源的連接 | WWW-Authenticate: Basic realm="Access to staging site" |
| X-Content-Type-Options | 避免浏覽器MIME類型嗅探 | X-Content-Type-Options: nosniff |
| X-Frame-Options | 节制頁面是不是可以在frame或iframe中顯示 | X-Frame-Options: DENY |
| X-XSS-Protection | 啓用跨站腳本過濾 | X-XSS-Protection: 1; mode=block |
通用頭 (General Headers)
| Header名稱 | 說明 | 示例 |
|---|---|---|
| Cache-Control | 节制緩存行爲 | Cache-Control: no-cache, no-store, must-revalidate |
| Connection | 节制網絡連接 | Connection: keep-alive |
| Date | 消息産生的日期和時間 | Date: Wed, 21 Oct 2015 07:28:00 GMT |
| Pragma | 用于指定緩存行爲(HTTP/1.0兼容) | Pragma: no-cache |
| Trailer | 允許發送方在分塊發送的消息後面添加額外的元信息 | Trailer: Expires |
| Transfer-Encoding | 規定了傳輸消息體時采取的編碼编制 | Transfer-Encoding: chunked |
| Upgrade | 要求服務器升級到别的一個協議 | Upgrade: websocket |
| Via | 顯示代办代理服務器的相關信息 | Via: 1.1 proxy.example.com (nginx/1.16.1) |
| Warning | 奉告可能影響到消息內容的問題 | Warning: 199 Miscellaneous warning |
實體頭 (Entity Headers)
| Header名稱 | 說明 | 示例 |
|---|---|---|
| Allow | 對于特定資源有效的┞穲求编制 | Allow: GET, HEAD, PUT |
| Content-Encoding | 實體消息體的編碼编制 | Content-Encoding: gzip |
| Content-Language | 實體消息體的┞穁言 | Content-Language: zh-CN, en-US |
| Content-Length | 實體消息體的長度 | Content-Length: 1024 |
| Content-Location | 實體的位置 | Content-Location: /documents/foo.html |
| Content-MD5 | 實體消息體的MD5校驗值 | Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== |
| Content-Range | 實體消息體在完全消息體中的位置 | Content-Range: bytes 200-1023/1024 |
| Content-Type | 實體消息體的媒體類型 | Content-Type: text/html; charset=utf-8 |
| Expires | 實體消息體的過期日期和時間 | Expires: Wed, 21 Oct 2015 07:28:00 GMT |
| Last-Modified | 實體消息體的最後点窜日期和時間 | Last-Modified: Wed, 21 Oct 2015 07:28:00 GMT |