public class DefaultHttpResponse extends Object implements HttpResponse
Constructor and Description |
---|
DefaultHttpResponse(HttpVersion version,
HttpStatus status,
Map<String,String> headers)
Creates a new DefaultHttpResponse instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsHeader(String name)
Tells if the message contains some header
|
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() |
HttpVersion |
getProtocolVersion()
The HTTP version of the message
|
HttpStatus |
getStatus()
The HTTP status code for the HTTP response (e.g.
|
boolean |
isKeepAlive() |
String |
toString() |
public DefaultHttpResponse(HttpVersion version, HttpStatus status, Map<String,String> headers)
version
- The HTTP versionstatus
- The HTTP statusheaders
- The HTTP headerspublic HttpVersion getProtocolVersion()
getProtocolVersion
in interface HttpMessage
public String getContentType()
Content-Type
header of the message.getContentType
in interface HttpMessage
public boolean isKeepAlive()
isKeepAlive
in interface HttpMessage
true
if this message enables keep-alive connection.public String getHeader(String name)
getHeader
in interface HttpMessage
name
- The name of the desired headerpublic boolean containsHeader(String name)
containsHeader
in interface HttpMessage
name
- the Header's name we are looking fortrue
if the HTTP header with the specified name exists in this request.public Map<String,String> getHeaders()
getHeaders
in interface HttpMessage
Map
of HTTP headers whose key is a String
and whose value is a String
s.public HttpStatus getStatus()
getStatus
in interface HttpResponse
Copyright © 2004–2024 Apache MINA Project. All rights reserved.