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 SummaryModifier and TypeMethodDescriptionvoidaddCookie(ResponseCookie cookie) Add the givenResponseCookie.Return a mutable map with the cookies to send to the server.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.default booleansetRawStatusCode(@Nullable Integer value) Set the HTTP status code to the given value as an integer.booleansetStatusCode(@Nullable HttpStatusCode status) Set the HTTP status code of the response.Methods inherited from interface HttpMessagegetHeadersMethods inherited from interface ReactiveHttpOutputMessagebeforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith
- 
Method Details- 
setStatusCodeSet the HTTP status code of the response.- Parameters:
- status- the HTTP status as an- HttpStatusCodevalue
- Returns:
- falseif the status code change wasn't processed because the HTTP response is committed,- trueif successfully set.
 
- 
getStatusCode@Nullable HttpStatusCode 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
- 
getCookiesMultiValueMap<String, ResponseCookie> getCookies()Return a mutable map with the cookies to send to the server.
- 
addCookieAdd the givenResponseCookie.- Parameters:
- cookie- the cookie to add
- Throws:
- IllegalStateException- if the response has already been committed
 
 
-