类 AbstractServerHttpRequest
- java.lang.Object
- org.springframework.http.server.reactive.AbstractServerHttpRequest
- 直接已知子类:
MockServerHttpRequest
public abstract class AbstractServerHttpRequest extends Object implements ServerHttpRequest
Common base class forServerHttpRequest
implementations.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
嵌套类概要
从接口继承的嵌套类/接口 org.springframework.http.server.reactive.ServerHttpRequest
ServerHttpRequest.Builder
构造器概要
构造器 构造器 说明 AbstractServerHttpRequest(URI uri, String contextPath, HttpHeaders headers)
Constructor with the URI and headers for the request.
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 MultiValueMap<String,HttpCookie>
getCookies()
Return a read-only map of cookies sent by the client.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.abstract <T> T
getNativeRequest()
Return the underlying server response.RequestPath
getPath()
Returns a structured representation of the request path including the context path + path within application portions, path segments with encoded and decoded values, and path parameters.MultiValueMap<String,String>
getQueryParams()
Return a read-only map with parsed and decoded query parameter values.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).protected abstract MultiValueMap<String,HttpCookie>
initCookies()
Obtain the cookies from the underlying "native" request and adapt those to anHttpCookie
map.protected String
initId()
Obtain the request id to use, ornull
in which case the Object identity of this request instance is used.protected MultiValueMap<String,String>
initQueryParams()
A method for parsing of the query into name-value pairs.protected abstract SslInfo
initSslInfo()
Obtain SSL session information from the underlying "native" request.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.http.HttpRequest
getMethod, getMethodValue
从接口继承的方法 org.springframework.http.ReactiveHttpInputMessage
getBody
从接口继承的方法 org.springframework.http.server.reactive.ServerHttpRequest
getLocalAddress, getRemoteAddress, mutate
构造器详细资料
AbstractServerHttpRequest
public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, HttpHeaders headers)
Constructor with the URI and headers for the request.- 参数:
uri
- the URI for the requestcontextPath
- the context path for the requestheaders
- the headers for the request
方法详细资料
getId
public String getId()
从接口复制的说明:ServerHttpRequest
Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.- 指定者:
getId
在接口中ServerHttpRequest
- 另请参阅:
ServerWebExchange.getLogPrefix()
initId
@Nullable protected String initId()
Obtain the request id to use, ornull
in which case the Object identity of this request instance is used.- 从以下版本开始:
- 5.1
getURI
public URI getURI()
从接口复制的说明:HttpRequest
Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).- 指定者:
getURI
在接口中HttpRequest
- 返回:
- the URI of the request (never
null
)
getPath
public RequestPath getPath()
从接口复制的说明:ServerHttpRequest
Returns a structured representation of the request path including the context path + path within application portions, path segments with encoded and decoded values, and path parameters.- 指定者:
getPath
在接口中ServerHttpRequest
getHeaders
public HttpHeaders getHeaders()
从接口复制的说明:HttpMessage
Return the headers of this message.- 指定者:
getHeaders
在接口中HttpMessage
- 返回:
- a corresponding HttpHeaders object (never
null
)
getQueryParams
public MultiValueMap<String,String> getQueryParams()
从接口复制的说明:ServerHttpRequest
Return a read-only map with parsed and decoded query parameter values.- 指定者:
getQueryParams
在接口中ServerHttpRequest
initQueryParams
protected MultiValueMap<String,String> initQueryParams()
A 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.
getCookies
public MultiValueMap<String,HttpCookie> getCookies()
从接口复制的说明:ServerHttpRequest
Return a read-only map of cookies sent by the client.- 指定者:
getCookies
在接口中ServerHttpRequest
initCookies
protected abstract MultiValueMap<String,HttpCookie> initCookies()
Obtain the cookies from the underlying "native" request and adapt those to anHttpCookie
map. 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.
getSslInfo
@Nullable public SslInfo getSslInfo()
从接口复制的说明:ServerHttpRequest
Return the SSL session information if the request has been transmitted over a secure protocol including SSL certificates, if available.- 指定者:
getSslInfo
在接口中ServerHttpRequest
- 返回:
- the session information, or
null
if none available
initSslInfo
@Nullable protected abstract SslInfo initSslInfo()
Obtain SSL session information from the underlying "native" request.- 返回:
- the session information, or
null
if none available - 从以下版本开始:
- 5.0.2
getNativeRequest
public 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.