org.springframework.http.server.reactive

## Interface ServerHttpResponse

- All Superinterfaces:
    HttpMessage, ReactiveHttpOutputMessage
  All Known Implementing Classes:
    AbstractListenerServerHttpResponse, AbstractServerHttpResponse, HttpHeadResponseDecorator, MockServerHttpResponse, ServerHttpResponseDecorator

      public interface ServerHttpResponse
      extends ReactiveHttpOutputMessage

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

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCookie(ResponseCookie cookie)` Add the given `ResponseCookie`.
    `MultiValueMap<String,ResponseCookie>` | `getCookies()` Return a mutable map with the cookies to send to the server.
    `default Integer` | `getRawStatusCode()` Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.
    `HttpStatus` | `getStatusCode()` Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.
    `default boolean` | `setRawStatusCode(Integer value)` Set the HTTP status code to the given value (potentially non-standard and not resolvable through the `HttpStatus` enum) as an integer.
    `boolean` | `setStatusCode(HttpStatus status)` Set the HTTP status code of the response.

    - ### Methods inherited from interface org.springframework.http.ReactiveHttpOutputMessage

      `beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith`

    - ### Methods inherited from interface org.springframework.http.HttpMessage

      `getHeaders`

- - ### Method Detail

    - #### setStatusCode

          boolean setStatusCode(@Nullable
                                HttpStatus status)

      Set the HTTP status code of the response.
      Parameters:
        `status` - the HTTP status as an `HttpStatus` enum value
      Returns:
        `false` if the status code change wasn't processed because the HTTP response is committed, `true` if successfully set.

    - #### getStatusCode

          @Nullable
          HttpStatus 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 the status code value is outside the `HttpStatus` enum range, or if there is no default value from the underlying server.

    - #### setRawStatusCode

          default boolean setRawStatusCode(@Nullable
                                           Integer value)

      Set the HTTP status code to the given value (potentially non-standard and not resolvable through the `HttpStatus` enum) as an integer.
      Parameters:
        `value` - the status code value
      Returns:
        `false` if the status code change wasn't processed because the HTTP response is committed, `true` if successfully set.
      Since:
        5.2.4

    - #### getRawStatusCode

          @Nullable
          default Integer getRawStatusCode()

      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.
      Since:
        5.2.4

    - #### getCookies

          MultiValueMap<String,ResponseCookie> getCookies()

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

    - #### addCookie

          void addCookie(ResponseCookie cookie)

      Add the given `ResponseCookie`.
      Parameters:
        `cookie` - the cookie to add
      Throws:
        `IllegalStateException` - if the response has already been committed