public interface Request
HandlerFunction
.
Access to headers and body is offered by Request.Headers
and
body(BodyExtractor)
respectively.Modifier and Type | Interface and Description |
---|---|
static interface |
Request.Headers
Represents the headers of the HTTP request.
|
Modifier and Type | Method and Description |
---|---|
<T> Optional<T> |
attribute(String name)
Return the request attribute value if present.
|
<T> T |
body(BodyExtractor<T> extractor)
Extract the body with the given
BodyExtractor . |
Request.Headers |
headers()
Return the headers of this request.
|
HttpMethod |
method()
Return the HTTP method.
|
default String |
path()
Return the request path.
|
default Optional<String> |
pathVariable(String name)
Return the path variable with the given name, if present.
|
Map<String,String> |
pathVariables()
Return all path variables.
|
default Optional<String> |
queryParam(String name)
Return the first query parameter with the given name, if present.
|
List<String> |
queryParams(String name)
Return all query parameter with the given name.
|
URI |
uri()
Return the request URI.
|
HttpMethod method()
URI uri()
default String path()
Request.Headers headers()
<T> T body(BodyExtractor<T> extractor)
BodyExtractor
.T
- the type of the body returnedextractor
- the BodyExtractor
that reads from the request<T> Optional<T> attribute(String name)
T
- the attribute typename
- the attribute namedefault Optional<String> queryParam(String name)
name
- the parameter nameList<String> queryParams(String name)
name
- the parameter namedefault Optional<String> pathVariable(String name)
name
- the variable name