public interface AsyncRequest
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
addHeader(CharSequence name,
String value)
已过时。
header should not been modified in a request
|
default void |
addHeader(String name,
String value)
已过时。
header should not been modified in a request
|
io.netty.buffer.ByteBufAllocator |
alloc()
Get current allocator.
|
String[] |
attributeNames()
Returns an
String[] containing the names of the attributes available to this request |
default byte[] |
body()
get body
|
io.netty.buffer.ByteBuf |
byteBufBody()
Get ByteBuf result of http body.
|
default boolean |
containsHeader(CharSequence name)
Returns a boolean indicating whether the named response header has already been set.
|
default boolean |
containsHeader(String name) |
default boolean |
containsTrailer(CharSequence name)
Returns a boolean indicating whether the named response header has already been set.
|
default boolean |
containsTrailer(String name) |
default int |
contentLength()
Body length.
|
Set<io.netty.handler.codec.http.cookie.Cookie> |
cookies()
Returns a set containing all of the
Cookie objects the client sent with this request. |
Object |
getAttribute(String name)
Returns the value of the named attribute as an Object, or
null if no attribute of the given name exists. |
default String[] |
getAttributeNames()
已过时。
use
attributeNames() |
default byte[] |
getBody()
已过时。
use
body() |
default io.netty.buffer.ByteBuf |
getBodyByteBuf()
已过时。
use
byteBufBody() |
default int |
getContentLength()
已过时。
use
contentLength() |
default io.netty.handler.codec.http.cookie.Cookie |
getCookie(String name)
Gets the
Cookie with given name. |
default Set<io.netty.handler.codec.http.cookie.Cookie> |
getCookies()
已过时。
use
cookies() |
default String |
getHeader(CharSequence name)
Returns the value of a header with the specified name.
|
default String |
getHeader(String name) |
default int |
getHeaderSize()
已过时。
use
headerSize() |
default io.netty.handler.codec.http.HttpHeaders |
getHttpHeaders()
已过时。
use
headers() |
default HttpInputStream |
getInputStream()
已过时。
use
inputStream() |
default Integer |
getIntHeader(CharSequence name)
Returns the integer value of a header with the specified name.
|
default Integer |
getIntHeader(String name) |
default Integer |
getIntTrailer(CharSequence name)
Returns the integer value of a trailing header with the specified name.
|
default Integer |
getIntTrailer(String name) |
default String |
getLocalAddr()
已过时。
use
localAddr() |
default int |
getLocalPort()
已过时。
use
localPort() |
default String |
getMethod()
已过时。
use
rawMethod() |
default String |
getParameter(String parName)
Get parameter This pair of parameter can be from url parameters or body k-v values when Content-Type equals to
'x-www-form-urlencoded'
|
default Map<String,List<String>> |
getParameterMap()
已过时。
use
parameterMap() |
default List<String> |
getParameters(String parName)
Get parameters This pair of parameter can be from url parameters or body k-v values when Content-Type equals to
'x-www-form-urlencoded'
|
default String |
getProtocol()
已过时。
use
protocol() |
default String |
getRemoteAddr()
已过时。
use
remoteAddr() |
default String |
getRequestURI()
已过时。
use
path() |
default String |
getScheme()
已过时。
use
scheme() |
default Short |
getShortHeader(CharSequence name)
Returns the integer value of a header with the specified name.
|
default Short |
getShortHeader(String name) |
default Short |
getShortTrailer(CharSequence name)
Returns the integer value of a trailing header with the specified name.
|
default Short |
getShortTrailer(String name) |
default String |
getTcpSourceAddr()
已过时。
use
tcpSourceAddr() |
default String |
getTrailer(CharSequence name)
Returns the value of a trailing header with the specified name.
|
default String |
getTrailer(String name) |
default <T> T |
getUncheckedAttribute(String name)
Returns the value of the named attribute as an Object and cast to target type, or
null if no attribute of
the given name exists. |
default String |
getURIAndQueryString()
已过时。
use
uri() |
default boolean |
hasAttribute(String name)
Check whether the given attribute is present in current request.
|
io.netty.handler.codec.http.HttpHeaders |
headers()
Get http headers
|
default int |
headerSize()
已过时。
compute by yourself please
|
io.netty.handler.codec.http.HttpVersion |
httpVersion()
HttpVersion, such as HTTP/1.1
|
HttpInputStream |
inputStream()
Get input stream
|
String |
localAddr()
Returns the Internet Protocol (IP) address of the interface on which the request was received.
|
int |
localPort()
Returns the port of the interface on which the request was received.
|
io.netty.handler.codec.http.HttpMethod |
method()
HTTP methodPathMatcher
|
Map<String,List<String>> |
parameterMap()
Get parameter map This pair of parameters can be from url parameters or body k-v values when Content-Type equals
to 'x-www-form-urlencoded'
|
String |
path()
Http path except parameters.
|
default String |
protocol()
Protocol string, such as HTTP/1.1
|
String |
query()
Returns the query part of the uri.
|
default String |
rawMethod()
HTTP method as String type.
|
String |
remoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
|
int |
remotePort()
Returns the Internet Protocol (PORT) address of the client or last proxy that sent the request.
|
Object |
removeAttribute(String name)
Removes an attribute from this request.
|
default <T> T |
removeUncheckedAttribute(String name)
Removes an attribute from this request and cast to target type.
|
String |
scheme()
HTTP or HTTPS
|
void |
setAttribute(String name,
Object value)
Stores an attribute in this request.
|
default void |
setHeader(CharSequence name,
String value)
已过时。
header should not been modified in a request
|
default void |
setHeader(String name,
String value)
已过时。
header should not been modified in a request
|
String |
tcpSourceAddr()
Returns the last proxy that sent the request.
|
io.netty.handler.codec.http.HttpHeaders |
trailers()
Gets the trailing headers of this request.
|
String |
uri()
Http full url.
|
default String protocol()
io.netty.handler.codec.http.HttpVersion httpVersion()
String scheme()
String uri()
String path()
String query()
io.netty.handler.codec.http.HttpMethod method()
default String rawMethod()
HttpInputStream inputStream()
default byte[] body()
io.netty.buffer.ByteBuf byteBufBody()
default int contentLength()
String remoteAddr()
String tcpSourceAddr()
int remotePort()
String localAddr()
int localPort()
default String getParameter(String parName)
parName - parameter namedefault List<String> getParameters(String parName)
parName - parameter nameMap<String,List<String>> parameterMap()
io.netty.handler.codec.http.HttpHeaders headers()
default boolean containsHeader(CharSequence name)
name - namedefault boolean containsHeader(String name)
default String getHeader(CharSequence name)
name - The name of the header to searchnull if there is no such headerdefault String getHeader(String name)
getHeader(CharSequence)default Integer getIntHeader(CharSequence name)
name - the name of the header to searchnull if there's no
such header or its value is not an integer.default Short getShortHeader(CharSequence name)
name - the name of the header to searchnull if there's no
such header or its value is not an integer.@Deprecated default int headerSize()
io.netty.handler.codec.http.HttpHeaders trailers()
default boolean containsTrailer(CharSequence name)
name - namedefault boolean containsTrailer(String name)
default String getTrailer(CharSequence name)
name - The name of the trailing header to searchnull if there is no such trailing headerdefault String getTrailer(String name)
getTrailer(CharSequence)default Integer getIntTrailer(CharSequence name)
name - the name of the trailing header to searchnull
if there's no such trailing header or its value is not an integer.default Short getShortTrailer(CharSequence name)
name - the name of the header to searchnull
if there's no such trailing header or its value is not an integer.Set<io.netty.handler.codec.http.cookie.Cookie> cookies()
Cookie objects the client sent with this request.Cookie objects the client sent with this request, returns an empty set if no cookies
were sent.default io.netty.handler.codec.http.cookie.Cookie getCookie(String name)
Cookie with given name.name - cookie namenull if did not find.Object getAttribute(String name)
null if no attribute of the given name exists.name - namevoid setAttribute(String name, Object value)
name - namevalue - valuedefault <T> T getUncheckedAttribute(String name)
null if no attribute of
the given name exists.name - nameObject removeAttribute(String name)
name - namedefault <T> T removeUncheckedAttribute(String name)
name - namedefault boolean hasAttribute(String name)
name - nametrue if the value of given attribute name is present, otherwise falseString[] attributeNames()
String[] containing the names of the attributes available to this request@Beta io.netty.buffer.ByteBufAllocator alloc()
@Deprecated default String getProtocol()
protocol()@Deprecated default String getScheme()
scheme()@Deprecated default String getRequestURI()
path()@Deprecated default String getURIAndQueryString()
uri()@Deprecated default String getMethod()
rawMethod()@Deprecated default io.netty.handler.codec.http.HttpHeaders getHttpHeaders()
headers()@Deprecated default HttpInputStream getInputStream()
inputStream()@Deprecated default byte[] getBody()
body()@Deprecated default io.netty.buffer.ByteBuf getBodyByteBuf()
byteBufBody()@Deprecated default int getContentLength()
contentLength()@Deprecated default Map<String,List<String>> getParameterMap()
parameterMap()@Deprecated default Set<io.netty.handler.codec.http.cookie.Cookie> getCookies()
cookies()@Deprecated default String getRemoteAddr()
remoteAddr()@Deprecated default String getTcpSourceAddr()
tcpSourceAddr()@Deprecated default int getLocalPort()
localPort()@Deprecated default int getHeaderSize()
headerSize()@Deprecated default String getLocalAddr()
localAddr()@Deprecated default String[] getAttributeNames()
attributeNames()@Deprecated default void setHeader(String name, String value)
If there is an existing header with the same name, it is removed.
value - The value of the header being set@Deprecated default void setHeader(CharSequence name, String value)
If there is an existing header with the same name, it is removed.
value - The value of the header being set@Deprecated default void addHeader(String name, String value)
name - namevalue - value@Deprecated default void addHeader(CharSequence name, String value)
name - namevalue - valueCopyright © 2020. All rights reserved.