|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
public interface HttpMessage
An HTTP message which provides common properties for HttpRequest
and
HttpResponse
.
HttpHeaders
方法摘要 | |
---|---|
void |
addHeader(java.lang.String name,
java.lang.Object value)
Adds a new header with the specified name and value. |
void |
clearHeaders()
Removes all headers from this message. |
boolean |
containsHeader(java.lang.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()
已过时。 Use HttpHeaders.getContentLength(HttpMessage) instead. |
long |
getContentLength(long defaultValue)
已过时。 Use HttpHeaders.getContentLength(HttpMessage, long) instead. |
java.lang.String |
getHeader(java.lang.String name)
Returns the header value with the specified header name. |
java.util.Set<java.lang.String> |
getHeaderNames()
Returns the Set of all header names that this message contains. |
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> |
getHeaders()
Returns the all header names and values that this message contains. |
java.util.List<java.lang.String> |
getHeaders(java.lang.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 this message does not have any
content but the HttpChunk s, which is generated by
HttpMessageDecoder consecutively, contain the actual content. |
boolean |
isKeepAlive()
已过时。 Use HttpHeaders.isKeepAlive(HttpMessage) instead. |
void |
removeHeader(java.lang.String name)
Removes the header with the specified name. |
void |
setChunked(boolean chunked)
Sets if this message does not have any content but the HttpChunk s, which is generated by HttpMessageDecoder
consecutively, contain the actual content. |
void |
setContent(ChannelBuffer content)
Sets the content of this message. |
void |
setHeader(java.lang.String name,
java.lang.Iterable<?> values)
Sets a new header with the specified name and values. |
void |
setHeader(java.lang.String name,
java.lang.Object value)
Sets a new header with the specified name and value. |
void |
setProtocolVersion(HttpVersion version)
Sets the protocol version of this message. |
方法详细信息 |
---|
java.lang.String getHeader(java.lang.String name)
null
if there is no such headerjava.util.List<java.lang.String> getHeaders(java.lang.String name)
List
of header values. An empty list if there is no
such header.java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> getHeaders()
List
of the header name-value pairs. An empty list
if there is no header in this message.boolean containsHeader(java.lang.String name)
true
if and only if there is a header with the specified
header name.
java.util.Set<java.lang.String> getHeaderNames()
Set
of all header names that this message contains.
HttpVersion getProtocolVersion()
void setProtocolVersion(HttpVersion version)
ChannelBuffer getContent()
isChunked()
returns true
, an
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(java.lang.String name, java.lang.Object value)
void setHeader(java.lang.String name, java.lang.Object value)
void setHeader(java.lang.String name, java.lang.Iterable<?> values)
void removeHeader(java.lang.String name)
void clearHeaders()
@Deprecated long getContentLength()
HttpHeaders.getContentLength(HttpMessage)
instead.
@Deprecated long getContentLength(long defaultValue)
HttpHeaders.getContentLength(HttpMessage, long)
instead.
boolean isChunked()
true
if and only if this message does not have any
content but the HttpChunk
s, which is generated by
HttpMessageDecoder
consecutively, contain the actual content.
Please note that this method will keep returning true
if the
"Transfer-Encoding"
of this message is "chunked"
, even if
you attempt to override this property by calling setChunked(boolean)
with false
.
void setChunked(boolean chunked)
HttpChunk
s, which is generated by HttpMessageDecoder
consecutively, contain the actual content.
If this method is called with true
, the content of this message
becomes ChannelBuffers.EMPTY_BUFFER
.
Even if this method is called with false
, isChunked()
will keep returning true
if the "Transfer-Encoding"
of
this message is "chunked"
.
@Deprecated boolean isKeepAlive()
HttpHeaders.isKeepAlive(HttpMessage)
instead.
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |