Interface HttpMessage
- All Known Subinterfaces:
HttpRequest
,HttpResponse
- All Known Implementing Classes:
DefaultHttpMessage
,DefaultHttpRequest
,DefaultHttpResponse
public interface HttpMessage
An HTTP message which provides common properties for
HttpRequest
and
HttpResponse
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the content of this message.Returns the protocol version of this message.headers()
Returns the headers of this message.boolean
Returnstrue
if and only if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.void
setChunked
(boolean chunked) Sets if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.void
setContent
(ChannelBuffer content) Sets the content of this message.void
setProtocolVersion
(HttpVersion version) Sets the protocol version of this message.
-
Method Details
-
getProtocolVersion
HttpVersion getProtocolVersion()Returns the protocol version of this message. -
setProtocolVersion
Sets the protocol version of this message. -
headers
HttpHeaders headers()Returns the headers of this message. -
getContent
ChannelBuffer getContent()Returns the content of this message. If there is no content orisChunked()
returnstrue
, anChannelBuffers.EMPTY_BUFFER
is returned. -
setContent
Sets the content of this message. Ifnull
is specified, the content of this message will be set toChannelBuffers.EMPTY_BUFFER
. -
isChunked
boolean isChunked()Returnstrue
if and only if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.Please note that this method will keep returning
true
if the"Transfer-Encoding"
of this message is"chunked"
, even if you attempt to override this property by callingsetChunked(boolean)
withfalse
. -
setChunked
void setChunked(boolean chunked) Sets if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.If this method is called with
true
, the content of this message becomesChannelBuffers.EMPTY_BUFFER
.Even if this method is called with
false
,isChunked()
will keep returningtrue
if the"Transfer-Encoding"
of this message is"chunked"
.
-