Interface HttpMessage
-
- All Known Subinterfaces:
HttpRequest
,HttpResponse
- All Known Implementing Classes:
DefaultHttpMessage
,DefaultHttpRequest
,DefaultHttpResponse
public interface HttpMessage
An HTTP message which provides common properties forHttpRequest
andHttpResponse
.- See Also:
HttpHeaders
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelBuffer
getContent()
Returns the content of this message.HttpVersion
getProtocolVersion()
Returns the protocol version of this message.HttpHeaders
headers()
Returns the headers of this message.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.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 Detail
-
getProtocolVersion
HttpVersion getProtocolVersion()
Returns the protocol version of this message.
-
setProtocolVersion
void setProtocolVersion(HttpVersion version)
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
void setContent(ChannelBuffer content)
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"
.
-
-