Top Description Methods
org.springframework.http.server.reactive

public Interface ServerHttpResponse

extends ReactiveHttpOutputMessage
Known Direct Implementers
org.springframework.http.server.reactive.ServerHttpResponseDecorator, org.springframework.http.server.reactive.AbstractServerHttpResponse
Imports
org.springframework.http.HttpStatusCode, .ReactiveHttpOutputMessage, .ResponseCookie, org.springframework.lang.Nullable, org.springframework.util.MultiValueMap

Represents a reactive server-side HTTP response.
Authors
Arjen Poutsma, Sebastien Deleuze, Rossen Stoyanchev
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public void
addCookie(ResponseCookie
the cookie to add
cookie
)

Add the given ResponseCookie.

public MultiValueMap<String, ResponseCookie>
getCookies()

Return a mutable map with the cookies to send to the server.

public default Integer
getRawStatusCode()
Deprecated since 6.0. as of 6.0, in favor of getStatusCode()

Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.

public HttpStatusCode
getStatusCode()

Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.

public default boolean

Returns:

false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.
setRawStatusCode
(Integer
the status code value
value
)

Set the HTTP status code to the given value as an integer.

public boolean

Returns:

false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.
setStatusCode
(HttpStatusCode
the HTTP status as an HttpStatusCode value
status
)

Set the HTTP status code of the response.

Inherited from org.springframework.http.ReactiveHttpOutputMessage:
beforeCommitbufferFactoryisCommittedsetCompletewriteAndFlushWithwriteWith

Method Detail

addCookieback to summary
public void addCookie(ResponseCookie cookie)

Add the given ResponseCookie.

Parameters
cookie:ResponseCookie

the cookie to add

Exceptions
IllegalStateException:
if the response has already been committed
getCookiesback to summary
public MultiValueMap<String, ResponseCookie> getCookies()

Return a mutable map with the cookies to send to the server.

getRawStatusCodeback to summary
public default Integer getRawStatusCode()

Deprecated

since 6.0.

as of 6.0, in favor of 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 be null if there is no default value from the underlying server.

Annotations
@Deprecated
since:6.0
@Nullable
Since
5.2.4
getStatusCodeback to summary
public 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 be null if there is no default value from the underlying server.

Annotations
@Nullable
setRawStatusCodeback to summary
public default boolean setRawStatusCode(Integer value)

Set the HTTP status code to the given value as an integer.

Parameters
value:Integer

the status code value

Returns:boolean

false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.

Since
5.2.4
setStatusCodeback to summary
public boolean setStatusCode(HttpStatusCode status)

Set the HTTP status code of the response.

Parameters
status:HttpStatusCode

the HTTP status as an HttpStatusCode value

Returns:boolean

false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.