Interface ServerHttpResponse
- All Superinterfaces:
HttpMessage,ReactiveHttpOutputMessage
- All Known Implementing Classes:
AbstractListenerServerHttpResponse,AbstractServerHttpResponse,HttpHeadResponseDecorator,MockServerHttpResponse,ServerHttpResponseDecorator
Represents a reactive server-side HTTP response.
- Since:
- 5.0
- Author:
- Arjen Poutsma, Sebastien Deleuze, Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCookie(ResponseCookie cookie) Add the givenResponseCookie.Return a mutable map with the cookies to send to the server.default IntegerDeprecated, for removal: This API element is subject to removal in a future version.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.default booleansetRawStatusCode(Integer value) Set the HTTP status code to the given value as an integer.booleansetStatusCode(HttpStatusCode status) Set the HTTP status code of the response.Methods inherited from interface org.springframework.http.HttpMessage
getHeadersMethods inherited from interface org.springframework.http.ReactiveHttpOutputMessage
beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith
-
Method Details
-
setStatusCode
Set the HTTP status code of the response.- Parameters:
status- the HTTP status as anHttpStatusCodevalue- Returns:
falseif the status code change wasn't processed because the HTTP response is committed,trueif successfully set.
-
getStatusCode
Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may benullif there is no default value from the underlying server. -
setRawStatusCode
Set the HTTP status code to the given value as an integer.- Parameters:
value- the status code value- Returns:
falseif the status code change wasn't processed because the HTTP response is committed,trueif successfully set.- Since:
- 5.2.4
-
getRawStatusCode
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofgetStatusCode(), for removal in 7.0Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may benullif there is no default value from the underlying server.- Since:
- 5.2.4
-
getCookies
MultiValueMap<String,ResponseCookie> getCookies()Return a mutable map with the cookies to send to the server. -
addCookie
Add the givenResponseCookie.- Parameters:
cookie- the cookie to add- Throws:
IllegalStateException- if the response has already been committed
-
getStatusCode(), for removal in 7.0