| Header | 解釋 | 示例 |
|---|---|---|
| Accept-Ranges | 表明服務(wù)器是否支持指定范圍請(qǐng)求及哪種類型的分段請(qǐng)求 | Accept-Ranges: bytes |
| Age | 從原始服務(wù)器到代理緩存形成的估算時(shí)間(以秒計(jì),非負(fù)) | Age: 12 |
| Allow | 對(duì)某網(wǎng)絡(luò)資源的有效的請(qǐng)求行為,不允許則返回405 | Allow: GET, HEAD |
| Cache-Control | 告訴所有的緩存機(jī)制是否可以緩存及哪種類型 | Cache-Control: no-cache |
| Content-Encoding | web服務(wù)器支持的返回內(nèi)容壓縮編碼類型。 | Content-Encoding: gzip |
| Content-Language | 響應(yīng)體的語言 | Content-Language: en,zh |
| Content-Length | 響應(yīng)體的長(zhǎng)度 | Content-Length: 348 |
| Content-Location | 請(qǐng)求資源可替代的備用的另一地址 | Content-Location: /index.htm |
| Content-md5 | 返回資源的MD5校驗(yàn)值 | Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== |
| Content-Range | 在整個(gè)返回體中本部分的字節(jié)位置 | Content-Range: bytes 21010-47021/47022 |
| Content-Type | 返回內(nèi)容的MIME類型 | Content-Type: text/html; charset=utf-8 |
| Date | 原始服務(wù)器消息發(fā)出的時(shí)間 | Date: Tue, 15 Nov 2010 08:12:31 GMT |
| ETag | 請(qǐng)求變量的實(shí)體標(biāo)簽的當(dāng)前值 | ETag: “737060cd8c284d8af7ad3082f209582d” |
| Expires | 響應(yīng)過期的日期和時(shí)間 | Expires: Thu, 01 Dec 2010 16:00:00 GMT |
| Last-Modified | 請(qǐng)求資源的最后修改時(shí)間 | Last-Modified: Tue, 15 Nov 2010 12:45:26 GMT |
| Location | 用來重定向接收方到非請(qǐng)求URL的位置來完成請(qǐng)求或標(biāo)識(shí)新的資源 | Location: http://www.zcmhi.com/archives/94.html |
| PRagma | 包括實(shí)現(xiàn)特定的指令,它可應(yīng)用到響應(yīng)鏈上的任何接收方 | Pragma: no-cache |
| Proxy-Authenticate | 它指出認(rèn)證方案和可應(yīng)用到代理的該URL上的參數(shù) | Proxy-Authenticate: Basic |
| refresh | 應(yīng)用于重定向或一個(gè)新的資源被創(chuàng)造,在5秒之后重定向(由網(wǎng)景提出,被大部分瀏覽器支持) | Refresh: 5; url=http://www.zcmhi.com/archives/94.html |
| Retry-After | 如果實(shí)體暫時(shí)不可取,通知客戶端在指定時(shí)間之后再次嘗試 | Retry-After: 120 |
| Server | web服務(wù)器軟件名稱 | Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) |
| Set-Cookie | 設(shè)置Http Cookie | Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1 |
| Trailer | 指出頭域在分塊傳輸編碼的尾部存在 | Trailer: Max-Forwards |
| Transfer-Encoding | 文件傳輸編碼 | Transfer-Encoding:chunked |
| Vary | 告訴下游代理是使用緩存響應(yīng)還是從原始服務(wù)器請(qǐng)求 | Vary: * |
| Via | 告知代理客戶端響應(yīng)是通過哪里發(fā)送的 | Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) |
| Warning | 警告實(shí)體可能存在的問題 | Warning: 199 Miscellaneous warning |
| WWW-Authenticate | 表明客戶端請(qǐng)求實(shí)體應(yīng)該使用的授權(quán)方案 | WWW-Authenticate: Basic |
3.2 params的示例
[html] view plain copy3.3%20consumes/produces
[html] view%20plain copy4. 總結(jié)
在本文中,首先介紹了Content-Type主要支持的格式內(nèi)容,然后基于@RequestMapping標(biāo)注的內(nèi)容介紹了主要的使用方法,其中,headers, consumes,produces,都是使用Content-Type中使用的各種媒體格式內(nèi)容,可以基于這個(gè)格式內(nèi)容來進(jìn)行訪問的控制和過濾。
參考資料:
1. HTTP中支持的Content-Type: http://tool.oschina.NET/commons
2. Media Type介紹。 http://www.iteye.com/topic/1127120
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注