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.booleanReturnstrueif and only if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.voidsetChunked(boolean chunked) Sets if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.voidsetContent(ChannelBuffer content) Sets the content of this message.voidsetProtocolVersion(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_BUFFERis returned. -
setContent
Sets the content of this message. Ifnullis specified, the content of this message will be set toChannelBuffers.EMPTY_BUFFER. -
isChunked
boolean isChunked()Returnstrueif and only if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.Please note that this method will keep returning
trueif 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 theHttpChunks, which is generated byHttpMessageDecoderconsecutively, 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 returningtrueif the"Transfer-Encoding"of this message is"chunked".
-