Interface HttpMessage

All Known Subinterfaces:
HttpRequest, HttpResponse
All Known Implementing Classes:
DefaultHttpResponse, HttpRequestImpl

public interface HttpMessage
An HTTP message, the ancestor of HTTP request & response.
  • Method Details

    • getProtocolVersion

      HttpVersion getProtocolVersion()
      The HTTP version of the message
      Returns:
      HTTP/1.0 or HTTP/1.1
    • getContentType

      String getContentType()
      Gets the Content-Type header of the message.
      Returns:
      The content type.
    • isKeepAlive

      boolean isKeepAlive()
      Returns:
      true if this message enables keep-alive connection.
    • getHeader

      String getHeader(String name)
      Returns the value of the HTTP header with the specified name. If more than one header with the given name is associated with this request, one is selected and returned.
      Parameters:
      name - The name of the desired header
      Returns:
      The header value - or null if no header is found with the specified name
    • containsHeader

      boolean containsHeader(String name)
      Tells if the message contains some header
      Parameters:
      name - the Header's name we are looking for
      Returns:
      true if the HTTP header with the specified name exists in this request.
    • getHeaders

      Map<String,String> getHeaders()
      Returns:
      a read-only Map of HTTP headers whose key is a String and whose value is a String s.