public class RequestWrapper extends Object implements Request
Request interface that can be subclassed to adapt the request to a
handler function. All methods default to calling through to the wrapped request.| Modifier and Type | Class and Description |
|---|---|
static class |
RequestWrapper.HeadersWrapper
Implementation of the
Headers interface that can be subclassed to adapt the headers to a
handler function. |
Request.Headers| Constructor and Description |
|---|
RequestWrapper(Request request)
Create a new
RequestWrapper that wraps the given 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.
|
org.springframework.http.HttpMethod |
method()
Return the HTTP method.
|
String |
path()
Return the request path.
|
Optional<String> |
pathVariable(String name)
Return the path variable with the given name, if present.
|
Map<String,String> |
pathVariables()
Return all path variables.
|
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.
|
Request |
request()
Return the wrapped request.
|
URI |
uri()
Return the request URI.
|
public RequestWrapper(Request request)
RequestWrapper that wraps the given request.request - the request to wrappublic Request request()
public org.springframework.http.HttpMethod method()
Requestpublic Request.Headers headers()
Requestpublic <T> T body(BodyExtractor<T> extractor)
RequestBodyExtractor.public <T> Optional<T> attribute(String name)
Requestpublic Optional<String> queryParam(String name)
RequestqueryParam in interface Requestname - the parameter namepublic List<String> queryParams(String name)
RequestqueryParams in interface Requestname - the parameter namepublic Optional<String> pathVariable(String name)
RequestpathVariable in interface Requestname - the variable name