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 Details

    • 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 or isChunked() returns true, an ChannelBuffers.EMPTY_BUFFER is returned.
    • setContent

      void setContent(ChannelBuffer content)
      Sets the content of this message. If null is specified, the content of this message will be set to ChannelBuffers.EMPTY_BUFFER.
    • isChunked

      boolean isChunked()
      Returns true if and only if this message does not have any content but the HttpChunks, which is generated by HttpMessageDecoder 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 calling setChunked(boolean) with false.

    • setChunked

      void setChunked(boolean chunked)
      Sets if this message does not have any content but the HttpChunks, which is generated by HttpMessageDecoder consecutively, contain the actual content.

      If this method is called with true, the content of this message becomes ChannelBuffers.EMPTY_BUFFER.

      Even if this method is called with false, isChunked() will keep returning true if the "Transfer-Encoding" of this message is "chunked".