public class ServerHttpRequestDecorator extends Object implements ServerHttpRequest
ServerHttpRequest and delegates all methods to it.
Sub-classes can override specific methods selectively.ServerHttpRequest.Builder| Constructor and Description |
|---|
ServerHttpRequestDecorator(ServerHttpRequest delegate) |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Flux<DataBuffer> |
getBody()
Return the body of the message as a
Publisher. |
MultiValueMap<String,HttpCookie> |
getCookies()
Return a read-only map of cookies sent by the client.
|
ServerHttpRequest |
getDelegate() |
HttpHeaders |
getHeaders()
Return the headers of this message.
|
String |
getId()
Return an id that represents the underlying connection, if available,
or the request for the purpose of correlating log messages.
|
InetSocketAddress |
getLocalAddress()
Return the local address the request was accepted on, if available.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
String |
getMethodValue()
Return the HTTP method of the request as a String value.
|
static <T> T |
getNativeRequest(ServerHttpRequest request)
Return the native request of the underlying server API, if possible,
also unwrapping
ServerHttpRequestDecorator if necessary. |
RequestPath |
getPath()
Returns a structured representation of the full request path up to but
not including the
query. |
MultiValueMap<String,String> |
getQueryParams()
Return a read-only map with parsed and decoded query parameter values.
|
InetSocketAddress |
getRemoteAddress()
Return the remote address where this request is connected to, if available.
|
SslInfo |
getSslInfo()
Return the SSL session information if the request has been transmitted
over a secure protocol including SSL certificates, if available.
|
URI |
getURI()
Return the URI of the request (including a query string if any,
but only if it is well-formed for a URI representation).
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmutatepublic ServerHttpRequestDecorator(ServerHttpRequest delegate)
public ServerHttpRequest getDelegate()
public String getId()
ServerHttpRequestgetId in interface ServerHttpRequestServerWebExchange.getLogPrefix()@Nullable public HttpMethod getMethod()
HttpRequestgetMethod in interface HttpRequestnull
if not resolvable (e.g. in case of a non-standard HTTP method)HttpRequest.getMethodValue(),
HttpMethod.resolve(String)public String getMethodValue()
HttpRequestgetMethodValue in interface HttpRequestHttpRequest.getMethod()public URI getURI()
HttpRequestgetURI in interface HttpRequestnull)public RequestPath getPath()
ServerHttpRequestquery.
The returned path is sub-divided into a
RequestPath.contextPath() portion and the remaining
pathWithinApplication portion.
The latter can be passed into methods of
PathPattern for path
matching purposes.
getPath in interface ServerHttpRequestpublic MultiValueMap<String,String> getQueryParams()
ServerHttpRequestgetQueryParams in interface ServerHttpRequestpublic HttpHeaders getHeaders()
HttpMessagegetHeaders in interface HttpMessagenull)public MultiValueMap<String,HttpCookie> getCookies()
ServerHttpRequestgetCookies in interface ServerHttpRequest@Nullable public InetSocketAddress getLocalAddress()
ServerHttpRequestgetLocalAddress in interface ServerHttpRequest@Nullable public InetSocketAddress getRemoteAddress()
ServerHttpRequestgetRemoteAddress in interface ServerHttpRequest@Nullable public SslInfo getSslInfo()
ServerHttpRequestgetSslInfo in interface ServerHttpRequestnull if none availablepublic reactor.core.publisher.Flux<DataBuffer> getBody()
ReactiveHttpInputMessagePublisher.getBody in interface ReactiveHttpInputMessagepublic static <T> T getNativeRequest(ServerHttpRequest request)
ServerHttpRequestDecorator if necessary.T - the expected native request typerequest - the request to checkIllegalArgumentException - if the native request can't be obtained