Package org.apache.mina.http.api
Interface HttpMessage
-
- All Known Subinterfaces:
HttpRequest,HttpResponse
- All Known Implementing Classes:
DefaultHttpResponse,HttpRequestImpl
public interface HttpMessageAn HTTP message, the ancestor of HTTP request & response.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsHeader(java.lang.String name)Tells if the message contains some headerjava.lang.StringgetContentType()Gets theContent-Typeheader of the message.java.lang.StringgetHeader(java.lang.String name)Returns the value of the HTTP header with the specified name.java.util.Map<java.lang.String,java.lang.String>getHeaders()HttpVersiongetProtocolVersion()The HTTP version of the messagebooleanisKeepAlive()
-
-
-
Method Detail
-
getProtocolVersion
HttpVersion getProtocolVersion()
The HTTP version of the message- Returns:
- HTTP/1.0 or HTTP/1.1
-
getContentType
java.lang.String getContentType()
Gets theContent-Typeheader of the message.- Returns:
- The content type.
-
isKeepAlive
boolean isKeepAlive()
- Returns:
trueif this message enables keep-alive connection.
-
getHeader
java.lang.String getHeader(java.lang.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(java.lang.String name)
Tells if the message contains some header- Parameters:
name- the Header's name we are looking for- Returns:
trueif the HTTP header with the specified name exists in this request.
-
getHeaders
java.util.Map<java.lang.String,java.lang.String> getHeaders()
- Returns:
- a read-only
Mapof HTTP headers whose key is aStringand whose value is aStrings.
-
-