Class AbstractServerHttpRequest
java.lang.Object
org.springframework.http.server.reactive.AbstractServerHttpRequest
- All Implemented Interfaces:
- HttpMessage,- HttpRequest,- ReactiveHttpInputMessage,- ServerHttpRequest
- Direct Known Subclasses:
- MockServerHttpRequest
Common base class for 
ServerHttpRequest implementations.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.http.server.reactive.ServerHttpRequestServerHttpRequest.Builder
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractServerHttpRequest(URI uri, String contextPath, HttpHeaders headers) Constructor with the URI and headers for the request.AbstractServerHttpRequest(URI uri, String contextPath, MultiValueMap<String, String> headers) Constructor with the URI and headers for the request.
- 
Method SummaryModifier and TypeMethodDescriptionReturn a read-only map of cookies sent by the client.Return the headers of this message.getId()Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.abstract <T> TReturn the underlying server response.getPath()Returns a structured representation of the full request path up to but not including thequery.Return a read-only map with parsed and decoded query parameter values.Return the SSL session information if the request has been transmitted over a secure protocol including SSL certificates, if available.getURI()Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).protected abstract MultiValueMap<String,HttpCookie> Obtain the cookies from the underlying "native" request and adapt those to anHttpCookiemap.protected StringinitId()Obtain the request id to use, ornullin which case the Object identity of this request instance is used.protected MultiValueMap<String,String> A method for parsing of the query into name-value pairs.protected abstract SslInfoObtain SSL session information from the underlying "native" request.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.HttpRequestgetMethod, getMethodValueMethods inherited from interface org.springframework.http.ReactiveHttpInputMessagegetBodyMethods inherited from interface org.springframework.http.server.reactive.ServerHttpRequestgetLocalAddress, getRemoteAddress, mutate
- 
Constructor Details- 
AbstractServerHttpRequestpublic AbstractServerHttpRequest(URI uri, @Nullable String contextPath, MultiValueMap<String, String> headers) Constructor with the URI and headers for the request.- Parameters:
- uri- the URI for the request
- contextPath- the context path for the request
- headers- the headers for the request (as- MultiValueMap)
- Since:
- 5.3
 
- 
AbstractServerHttpRequestConstructor with the URI and headers for the request.- Parameters:
- uri- the URI for the request
- contextPath- the context path for the request
- headers- the headers for the request (as- HttpHeaders)
 
 
- 
- 
Method Details- 
getIdDescription copied from interface:ServerHttpRequestReturn an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.- Specified by:
- getIdin interface- ServerHttpRequest
- See Also:
 
- 
initIdObtain the request id to use, ornullin which case the Object identity of this request instance is used.- Since:
- 5.1
 
- 
getURIDescription copied from interface:HttpRequestReturn the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).- Specified by:
- getURIin interface- HttpRequest
- Returns:
- the URI of the request (never null)
 
- 
getPathDescription copied from interface:ServerHttpRequestReturns a structured representation of the full request path up to but not including thequery.The returned path is sub-divided into a RequestPath.contextPath()portion and the remainingpathWithinApplicationportion. The latter can be passed into methods ofPathPatternfor path matching purposes.- Specified by:
- getPathin interface- ServerHttpRequest
 
- 
getHeadersDescription copied from interface:HttpMessageReturn the headers of this message.- Specified by:
- getHeadersin interface- HttpMessage
- Returns:
- a corresponding HttpHeaders object (never null)
 
- 
getQueryParamsDescription copied from interface:ServerHttpRequestReturn a read-only map with parsed and decoded query parameter values.- Specified by:
- getQueryParamsin interface- ServerHttpRequest
 
- 
initQueryParamsA method for parsing of the query into name-value pairs. The return value is turned into an immutable map and cached.Note that this method is invoked lazily on first access to getQueryParams(). The invocation is not synchronized but the parsing is thread-safe nevertheless.
- 
getCookiesDescription copied from interface:ServerHttpRequestReturn a read-only map of cookies sent by the client.- Specified by:
- getCookiesin interface- ServerHttpRequest
 
- 
initCookiesObtain the cookies from the underlying "native" request and adapt those to anHttpCookiemap. The return value is turned into an immutable map and cached.Note that this method is invoked lazily on access to getCookies(). Sub-classes should synchronize cookie initialization if the underlying "native" request does not provide thread-safe access to cookie data.
- 
getSslInfoDescription copied from interface:ServerHttpRequestReturn the SSL session information if the request has been transmitted over a secure protocol including SSL certificates, if available.- Specified by:
- getSslInfoin interface- ServerHttpRequest
- Returns:
- the session information, or nullif none available
 
- 
initSslInfoObtain SSL session information from the underlying "native" request.- Returns:
- the session information, or nullif none available
- Since:
- 5.0.2
 
- 
getNativeRequestpublic abstract <T> T getNativeRequest()Return the underlying server response.Note: This is exposed mainly for internal framework use such as WebSocket upgrades in the spring-webflux module. 
 
-