public interface ServerHttpResponse extends HttpOutputMessage, java.io.Flushable, java.io.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 java.io.IOException
After the first flush, headers can no longer be changed. Only further content writing and content flushing is possible.
flush
in interface java.io.Flushable
java.io.IOException
void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable