Package org.springframework.http.server
Interface ServerHttpResponse
- All Superinterfaces:
- AutoCloseable,- Closeable,- Flushable,- HttpMessage,- HttpOutputMessage
- All Known Implementing Classes:
- DelegatingServerHttpResponse,- ServletServerHttpResponse
Represents a server-side HTTP response.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close this response, freeing any resources created.voidflush()Ensure that the headers and the content of the response are written out.voidsetStatusCode(HttpStatus status) Set the HTTP status code of the response.Methods inherited from interface org.springframework.http.HttpMessagegetHeadersMethods inherited from interface org.springframework.http.HttpOutputMessagegetBody
- 
Method Details- 
setStatusCodeSet the HTTP status code of the response.- Parameters:
- status- the HTTP status as an HttpStatus enum value
 
- 
flushEnsure 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:
- flushin interface- Flushable
- Throws:
- IOException
 
- 
closevoid close()Close this response, freeing any resources created.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
-