public interface ServerHttpResponse extends HttpOutputMessage, Flushable, Closeable
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.
|
getBody
getHeaders
void setStatusCode(HttpStatus status)
status
- the HTTP status as an HttpStatus enum valuevoid flush() throws IOException
After the first flush, headers can no longer be changed. Only further content writing and content flushing is possible.
flush
in interface Flushable
IOException
void close()
close
in interface AutoCloseable
close
in interface Closeable