|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Request
Sitebricks abstraction of a request. May be a standard HTTP request, a tunneled Sitebricks RPC-over-HTTP, or another abstraction entirely.
| Nested Class Summary | |
|---|---|
static interface |
Request.AsyncCompletion<E>
|
static interface |
Request.AsyncRequestRead<E>
|
static interface |
Request.RequestRead<E>
|
| Method Summary | ||
|---|---|---|
String |
context()
|
|
String |
header(String name)
Returns the only value of a request header or null if the header was not present. |
|
com.google.common.collect.Multimap<String,String> |
headers()
Returns request headers as a multimap (to account for repeated headers). |
|
com.google.common.collect.Multimap<String,String> |
matrix()
Returns matrix parameters as a multimap (to account for repeated values). |
|
String |
matrixParam(String name)
Returns the only value of a matrix parameter or null if the parameter was not present. |
|
String |
method()
|
|
String |
param(String name)
Returns the only value of a request parameter or null if the parameter was not present. |
|
com.google.common.collect.Multimap<String,String> |
params()
Returns request parameters as a multimap (to account for repeated values). |
|
String |
path()
|
|
|
read(Class<E> type)
Reads the raw request data into an object of the given type. |
|
|
readAsync(Class<E> type)
Reads the request data into an object of the given type, but does so asynchronously. |
|
void |
readTo(OutputStream out)
Reads the request data directly into the given output stream. |
|
String |
uri()
|
|
| Method Detail |
|---|
<E> Request.RequestRead<E> read(Class<E> type)
Person p = request.read(Person.class).as(Json.class);
type - The target type to unmarshall the raw request data into.
void readTo(OutputStream out)
throws IOException
out - Any valid, open outputstream. Not closed after writing.
IOException - If an error occurs during the streaming.<E> Request.AsyncRequestRead<E> readAsync(Class<E> type)
type - The target type to unmarshall the raw request data into.com.google.common.collect.Multimap<String,String> headers()
com.google.common.collect.Multimap<String,String> params()
com.google.common.collect.Multimap<String,String> matrix()
String matrixParam(String name)
String param(String name)
Behaves exactly like ServletRequest.getParameter(String).
String header(String name)
Behaves exactly like HttpServletRequest.getHeader(String).
String uri()
String path()
String context()
String method()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||