public interface HttpRequest extends DataHolder
HttpHandler,
HttpResponse| 限定符和类型 | 字段和说明 |
|---|---|
static String |
COOKIE_HEADER |
| 限定符和类型 | 方法和说明 |
|---|---|
List<Map.Entry<String,String>> |
allHeaders()
Returns all headers sent from client.
|
String |
body()
The body
|
byte[] |
bodyAsBytes()
The body's byte array
|
HttpCookie |
cookie(String name)
Get a cookie with a specific name
|
List<HttpCookie> |
cookies() |
String |
cookieValue(String name)
Get the value of named cookie
|
HttpRequest |
data(String key,
Object value)
Store data value by key.
|
boolean |
hasHeader(String name)
Whether a specific HTTP header was present in the request.
|
String |
header(String name)
Retrieve the value single HTTP header.
|
List<String> |
headers(String name)
Retrieve all values for an HTTP header.
|
Object |
id()
A unique identifier for this request.
|
String |
method()
HTTP method (e.g.
|
String |
postParam(String key)
Get post parameter value.
|
Set<String> |
postParamKeys()
List all post parameter keys.
|
List<String> |
postParams(String key)
Get all post parameter values.
|
String |
queryParam(String key)
Get query parameter value.
|
Set<String> |
queryParamKeys()
List all query parameter keys.
|
List<String> |
queryParams(String key)
Get all query parameter values.
|
SocketAddress |
remoteAddress()
Remote address of connection (i.e. the host of the client).
|
long |
timestamp()
Timestamp (millis since epoch) of when this request was first received by the server.
|
String |
uri() |
HttpRequest |
uri(String uri)
Modify uri
|
data, data, dataKeysString uri()
HttpRequest uri(String uri)
uri - new uriString header(String name)
headers(String).List<String> headers(String name)
boolean hasHeader(String name)
List<HttpCookie> cookies()
HttpCookie cookie(String name)
name - cookie nameString queryParam(String key)
key - parameter namequeryParams(String)List<String> queryParams(String key)
key - parameter namequeryParam(String)Set<String> queryParamKeys()
queryParam(String)String postParam(String key)
key - parameter namepostParams(String)List<String> postParams(String key)
key - parameter namepostParam(String)Set<String> postParamKeys()
postParam(String)String cookieValue(String name)
name - cookie nameString method()
String body()
byte[] bodyAsBytes()
HttpRequest data(String key, Object value)
DataHolderdata 在接口中 DataHolderDataHolder.data()SocketAddress remoteAddress()
Object id()
long timestamp()
Copyright © 2014. All rights reserved.