HTTP請求中的常用響應頭
Location: http://www.it315.org/index.jsp
Server:apache tomcat
Content-Encoding: gzip
Content-Length: 80
Content-Language: zh-cn
Content-Type: text/html; charset=GB2312
Last-Modified: Tue, 11 Jul 2000 18:23:51 GMT
Refresh: 1;url=http://www.it315.org
Content-Disposition: attachment; filename=aaa.zip
Transfer-Encoding: chunked
Set-Cookie:SS=Q0=5Lb_nQ; path=/search
ETag: W/"7777-1242234904000"
Expires: -1
Cache-Control: no-cache
Pragma: no-cache
Connection: close/Keep-Alive
Date: Tue, 11 Jul 2000 18:23:51 GMT
響應頭
Location:服務器通過這個頭告訴瀏覽器去訪問哪個頁面,這個頭通常配合302狀態碼使用
Content-Encoding: 服務器通過這個頭告訴瀏覽器,回送的數據採用的壓縮格式
Content-Length: 服務器通過這個頭告訴瀏覽器,回送的數據的大小
Content-Type: 服務器通過這個頭告訴瀏覽器,回送數據的類型
Last-Modified: 服務器通過這個頭告訴瀏覽器,資源的最後修改時間
Refresh:服務器通過這個頭告訴瀏覽器,定時刷新網頁
Content-Disposition: attachment; filename=aaa.zip:服務器通過這個頭告訴瀏覽器,以下載方式打開數據
ETag: W/"7777-1242234904000":緩存相關的頭,爲每一個資源配一個唯一的編號
Expires: 0 刷新時間
Cache-Control: no-cache
Pragma: no-cache 這三個頭組合使用,讓瀏覽器不要緩存數據
HTTP實用頭字段:
HTTP請求頭字段
Range頭指示服務器只傳輸一部分Web資源。這個頭可以用來實現斷點續傳功能。Range字段可以通過三種格式設置要傳輸的字節範圍:
Range: bytes=1000-2000
傳輸範圍從1000到2000字節。
Range: bytes=1000-
傳輸Web資源中第1000個字節以後的所有內容。
Range bytes=1000
傳輸最後1000個字節。
HTTP響應消息頭字段
Accept-Ranges:這個字段說明Web服務器是否支持Range支持,則返回Accept-Ranges: bytes,如果不支持,則返回Accept-Ranges: none.
Content-Range:指定了返回的Web資源的字節範圍。這個字段值的格式是:例子: Content-Range:1000-3000/5000