org.springframework.http.server

## Interface ServerHttpResponse

- All Superinterfaces:
    AutoCloseable, Closeable, Flushable, HttpMessage, HttpOutputMessage
  All Known Implementing Classes:
    DelegatingServerHttpResponse, ServletServerHttpResponse

      public interface ServerHttpResponse
      extends HttpOutputMessage, Flushable, Closeable

  Represents a server-side HTTP response.
  Since:
    3.0
  Author:
    Arjen Poutsma

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close this response, freeing any resources created.
    `void` | `flush()` Ensure that the headers and the content of the response are written out.
    `void` | `setStatusCode(HttpStatus status)` Set the HTTP status code of the response.

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

      `getBody`

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

      `getHeaders`

- - ### Method Detail

    - #### setStatusCode

          void setStatusCode(HttpStatus status)

      Set the HTTP status code of the response.
      Parameters:
        `status` - the HTTP status as an HttpStatus enum value

    - #### flush

          void flush()
              throws IOException

      Ensure that the headers and the content of the response are written out.

      After the first flush, headers can no longer be changed. Only further content writing and content flushing is possible.

      Specified by:
        `flush` in interface `Flushable`
      Throws:
        `IOException`

    - #### close

          void close()

      Close this response, freeing any resources created.
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`