1
RESTEasy javax.ws.rs.core.Response
和javax.ws.rs.core.ResponseBuilder
如何與w3c HTTP (section 6.1)響應規範相關?RESTEasy Response與W3C規範
W2C定義HTTP響應爲:
Response = Status-Line ; Section 6.1
*((general-header ; Section 4.5
| response-header ; Section 6.2
| entity-header) CRLF) ; Section 7.1
CRLF
[ message-body ] ; Section 7.2
和的RESTEasy的ResponseBuilder對象上限定這些方法(除了別的以外):
- 狀態
- 頭
- 類型
- 實體
header
方法我明白可以讓你在響應中輸入自定義標題。 status
填充Status-Code
頭和type
,所述Content-Type
報頭。
但是,我不明白entity
它的作用填充實體頭或消息體或什麼?方法還允許你填充標準頭文件嗎?如果我返回一條描述錯誤原因的消息,應該在實體頭,消息體還是應該填充Reason-Phrase
頭?