org.apache.mina.http.api

## Interface HttpMessage

- All Superinterfaces:
    HttpPdu
  All Known Subinterfaces:
    HttpRequest, HttpResponse
  All Known Implementing Classes:
    DefaultHttpResponse, HttpRequestImpl

      public interface HttpMessage
      extends HttpPdu

  An HTTP message, the ancestor of HTTP request & response.
  Author:
    Apache MINA Project

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsHeader(String name)` Returns `true` if the HTTP header with the specified name exists in this request.
    `String` | `getContentType()` Gets the `Content-Type` header of the message.
    `String` | `getHeader(String name)` Returns the value of the HTTP header with the specified name.
    `Map<String,String>` | `getHeaders()` Returns a read-only `Map` of HTTP headers whose key is a `String` and whose value is a `String` s.
    `HttpVersion` | `getProtocolVersion()` The HTTP version of the message
    `boolean` | `isKeepAlive()` Returns `true` if this message enables keep-alive connection.

    - ### Methods inherited from interface org.apache.mina.http.api.HttpPdu

      `encode`

- - ### Method Detail

    - #### 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)

      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.

Copyright © 2009–2013 Apache MINA Project. All rights reserved.