|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpMessage
An HTTP message which provides common properties for HttpRequest
and
HttpResponse
.
HttpHeaders
Method Summary | |
---|---|
void |
addHeader(String name,
String value)
Adds a new header with the specified name and value. |
void |
clearHeaders()
Removes all headers from this message. |
boolean |
containsHeader(String name)
Returns true if and only if there is a header with the specified
header name. |
ChannelBuffer |
getContent()
Returns the content of this message. |
long |
getContentLength()
Returns the length of the content. |
long |
getContentLength(long defaultValue)
Returns the length of the content. |
String |
getHeader(String name)
Returns the header value with the specified header name. |
Set<String> |
getHeaderNames()
Returns the Set of all header names that this message contains. |
List<String> |
getHeaders(String name)
Returns the header values with the specified header name. |
HttpVersion |
getProtocolVersion()
Returns the protocol version of this message. |
boolean |
isChunked()
Returns true if and only if the "Transfer-Encoding" of
this message is "chunked" . |
boolean |
isKeepAlive()
Returns true if and only if the connection can remain open and
thus 'kept alive'. |
void |
removeHeader(String name)
Removes the header with the specified name. |
void |
setContent(ChannelBuffer content)
Sets the content of this message. |
void |
setHeader(String name,
Iterable<String> values)
Sets a new header with the specified name and values. |
void |
setHeader(String name,
String value)
Sets a new header with the specified name and value. |
Method Detail |
---|
String getHeader(String name)
null
if there is no such headerList<String> getHeaders(String name)
List
of header values. An empty list if there is no
such header.boolean containsHeader(String name)
true
if and only if there is a header with the specified
header name.
Set<String> getHeaderNames()
Set
of all header names that this message contains.
HttpVersion getProtocolVersion()
ChannelBuffer getContent()
ChannelBuffers.EMPTY_BUFFER
is returned.
void setContent(ChannelBuffer content)
null
is specified,
the content of this message will be set to ChannelBuffers.EMPTY_BUFFER
.
void addHeader(String name, String value)
void setHeader(String name, String value)
void setHeader(String name, Iterable<String> values)
void removeHeader(String name)
void clearHeaders()
long getContentLength()
getContent()
but from the
"Content-Length"
header, and thus they are independent from each
other.
0
if this message does not have
the "Content-Length"
headerlong getContentLength(long defaultValue)
getContent()
but from the
"Content-Length"
header, and thus they are independent from each
other.
defaultValue
if this message does
not have the "Content-Length"
headerboolean isChunked()
true
if and only if the "Transfer-Encoding"
of
this message is "chunked"
.
boolean isKeepAlive()
true
if and only if the connection can remain open and
thus 'kept alive'.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |