ServerRequest interface that can be subclassed
to adapt the request in a
handler filter function.
All methods default to calling through to the wrapped request.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ServerRequestWrapper.
Implementation of the |
| Modifier and Type | Field and Description |
|---|---|
| private final ServerRequest |
| Access | Constructor and Description |
|---|---|
| public | ServerRequestWrapper(ServerRequest
the request to wrap delegate)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public Optional | attribute(String
the attribute name name)Overrides default org. Get the request attribute value if present. |
| public Map | attributes()
Implements org. Get a mutable map of request attributes. |
| public <T> Mono | bind(Class<T>
the type of class to bind this request to bindType)Overrides default org. Bind to this request and return an instance of the given type. |
| public <T> Mono | bind(Class<T>
the type of class to bind this request to bindType, Consumer<WebDataBinder> used to customize the data binder, e.g. set
(dis)allowed fields dataBinderCustomizer)Implements org. Bind to this request and return an instance of the given type. |
| public <T> T | body(BodyExtractor<T, ? super ServerHttpRequest>
the extractor)BodyExtractor that reads from the requestImplements org. Extract the body with the given |
| public <T> T | body(BodyExtractor<T, ? super ServerHttpRequest>
the extractor, Map<String, Object> BodyExtractor that reads from the requestthe map of hints like hints)Jackson2CodecSupport#JSON_VIEW_HINT
to use to customize body extractionImplements org. Extract the body with the given |
| public <T> Flux | bodyToFlux(Class<? extends T>
the class of element in the elementClass)FluxImplements org. Extract the body to a |
| public <T> Flux | bodyToFlux(ParameterizedTypeReference<T>
a type reference describing the expected request body type typeReference)Implements org. Extract the body to a |
| public <T> Mono | bodyToMono(Class<? extends T>
the class of element in the elementClass)MonoImplements org. Extract the body to a |
| public <T> Mono | bodyToMono(ParameterizedTypeReference<T>
a type reference describing the expected response request type typeReference)Implements org. Extract the body to a |
| public MultiValueMap | cookies()
Implements org. Get the cookies of this request. |
| public ServerWebExchange | exchange()
Implements org. Get the web exchange that this request is based on. |
| public Mono | formData()
Implements org. Get the form data from the body of the request if the Content-Type is
|
| public ServerRequest. | headers()
Implements org. Get the headers of this request. |
| public Optional | localAddress()
Implements org. Get the local address to which this request is connected, if available. |
| public List | messageReaders()
Implements org. Get the readers used to convert the body of this request. |
| public HttpMethod | method()
Implements org. Get the HTTP method. |
| public String | methodName()
Implements org.
Deprecated
Get the name of the HTTP method. |
| public Mono | multipartData()
Implements org. Get the parts of a multipart request if the Content-Type is
|
| public String | path()
Overrides default org. Get the request path. |
| public PathContainer | pathContainer()
Overrides default org.
Deprecated
Get the request path as a |
| public String | pathVariable(String
the variable name name)Overrides default org. Get the path variable with the given name, if present. |
| public Map | pathVariables()
Implements org. Get all path variables for this request. |
| public Mono | principal()
Implements org. Get the authenticated user for the request, if any. |
| public Optional | queryParam(String
the parameter name name)Overrides default org. Get the first query parameter with the given name, if present. |
| public MultiValueMap | queryParams()
Implements org. Get all query parameters for this request. |
| public Optional | remoteAddress()
Implements org. Get the remote address to which this request is connected, if available. |
| public ServerRequest | |
| public RequestPath | requestPath()
Overrides default org. Get the request path as a |
| public Mono | session()
Implements org. Get the web session for this request. |
| public URI | uri()
Implements org. Get the request URI. |
| public UriBuilder | uriBuilder()
Implements org. Get a |
| delegate | back to summary |
|---|---|
| private final ServerRequest delegate | |
| ServerRequestWrapper | back to summary |
|---|---|
| public ServerRequestWrapper(ServerRequest delegate) Create a new
| |
| attribute | back to summary |
|---|---|
| public Optional Overrides default org. Doc from org. Get the request attribute value if present. | |
| attributes | back to summary |
|---|---|
| public Map Implements org. Doc from org. Get a mutable map of request attributes. | |
| bind | back to summary |
|---|---|
| public <T> Mono Overrides default org. Doc from org. Bind to this request and return an instance of the given type.
| |
| bind | back to summary |
|---|---|
| public <T> Mono Implements org. Doc from org. Bind to this request and return an instance of the given type.
| |
| body | back to summary |
|---|---|
| public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor) Implements org. Doc from org. Extract the body with the given
| |
| body | back to summary |
|---|---|
| public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor, Map<String, Object> hints) Implements org. Doc from org. Extract the body with the given
| |
| bodyToFlux | back to summary |
|---|---|
| public <T> Flux Implements org. Doc from org. Extract the body to a | |
| bodyToFlux | back to summary |
|---|---|
| public <T> Flux Implements org. Doc from org. Extract the body to a
| |
| bodyToMono | back to summary |
|---|---|
| public <T> Mono Implements org. Doc from org. Extract the body to a | |
| bodyToMono | back to summary |
|---|---|
| public <T> Mono Implements org. Doc from org. Extract the body to a
| |
| cookies | back to summary |
|---|---|
| public MultiValueMap Implements org. Doc from org. Get the cookies of this request.
| |
| exchange | back to summary |
|---|---|
| public ServerWebExchange exchange() Implements org. Doc from org. Get the web exchange that this request is based on. Note Manipulating the exchange directly (instead of using the methods provided on
| |
| formData | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Get the form data from the body of the request if the Content-Type is
Note calling this method causes the request body to
be read and parsed in full, and the resulting
| |
| headers | back to summary |
|---|---|
| public ServerRequest. Implements org. Doc from org. Get the headers of this request.
| |
| localAddress | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Get the local address to which this request is connected, if available.
| |
| messageReaders | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the readers used to convert the body of this request.
| |
| method | back to summary |
|---|---|
| public HttpMethod method() Implements org. Doc from org. Get the HTTP method.
| |
| methodName | back to summary |
|---|---|
| public String methodName() Implements org. Doc from org. Deprecated
Get the name of the HTTP method.
| |
| multipartData | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Get the parts of a multipart request if the Content-Type is
Note calling this method causes the request body to
be read and parsed in full, and the resulting
| |
| path | back to summary |
|---|---|
| public String path() Overrides default org. Doc from org. Get the request path.
| |
| pathContainer | back to summary |
|---|---|
| public PathContainer pathContainer() Overrides default org. Doc from org. Deprecated
Get the request path as a
| |
| pathVariable | back to summary |
|---|---|
| public String pathVariable(String name) Overrides default org. Doc from org. Get the path variable with the given name, if present. | |
| pathVariables | back to summary |
|---|---|
| public Map Implements org. Doc from org. Get all path variables for this request.
| |
| principal | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Get the authenticated user for the request, if any.
| |
| queryParam | back to summary |
|---|---|
| public Optional Overrides default org. Doc from org. Get the first query parameter with the given name, if present. | |
| queryParams | back to summary |
|---|---|
| public MultiValueMap Implements org. Doc from org. Get all query parameters for this request.
| |
| remoteAddress | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Get the remote address to which this request is connected, if available.
| |
| request | back to summary |
|---|---|
| public ServerRequest request() Return the wrapped request. | |
| requestPath | back to summary |
|---|---|
| public RequestPath requestPath() Overrides default org. Doc from org. Get the request path as a
| |
| session | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Get the web session for this request. Always guaranteed to return an instance either matching the session id requested by the client, or with a new session id either because the client did not specify one or because the underlying session had expired. Use of this method does not automatically create a session.
| |
| uri | back to summary |
|---|---|
| public URI uri() Implements org. Doc from org. Get the request URI.
| |
| uriBuilder | back to summary |
|---|---|
| public UriBuilder uriBuilder() Implements org. Doc from org. Get a Note as of 5.1 this method ignores
| |
Headers interface that can be subclassed
to adapt the headers in a
handler filter function.
All methods default to calling through to the wrapped headers.
| Modifier and Type | Field and Description |
|---|---|
| private final ServerRequest. |
| Access | Constructor and Description |
|---|---|
| public | HeadersWrapper(ServerRequest.
the headers to wrap headersCreate a new |
| headers | back to summary |
|---|---|
| private final ServerRequest. | |
| HeadersWrapper | back to summary |
|---|---|
| public HeadersWrapper(ServerRequest. Create a new
| |
| accept | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the list of acceptable media types, as specified by the Returns an empty list if the acceptable media types are unspecified.
| |
| acceptCharset | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the list of acceptable charsets, as specified by the
| |
| acceptLanguage | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the list of acceptable languages, as specified by the
| |
| asHttpHeaders | back to summary |
|---|---|
| public HttpHeaders asHttpHeaders() Implements org. Doc from org. Get the headers as an instance of
| |
| contentLength | back to summary |
|---|---|
| public OptionalLong contentLength() Implements org. Doc from org. Get the length of the body in bytes, as specified by the
| |
| contentType | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Get the media type of the body, as specified by the
| |
| header | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the header value(s), if any, for the header with the given name. Returns an empty list if no header values are found. | |
| host | back to summary |
|---|---|
| public InetSocketAddress host() Implements org. Doc from org. Get the value of the If the header value does not contain a port, the
port in the returned address will
be
| |
| range | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the value of the Returns an empty list when the range is unknown.
| |