接口 ServerHttpResponse
- 所有超级接口:
AutoCloseable
,Closeable
,Flushable
,HttpMessage
,HttpOutputMessage
- 所有已知实现类:
ServletServerHttpResponse
public interface ServerHttpResponse extends HttpOutputMessage, Flushable, Closeable
Represents a server-side HTTP response.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 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.从接口继承的方法 org.springframework.http.HttpMessage
getHeaders
从接口继承的方法 org.springframework.http.HttpOutputMessage
getBody
方法详细资料
setStatusCode
void setStatusCode(HttpStatus status)
Set the HTTP status code of the response.- 参数:
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.
- 指定者:
flush
在接口中Flushable
- 抛出:
IOException
close
void close()
Close this response, freeing any resources created.- 指定者:
close
在接口中AutoCloseable
- 指定者:
close
在接口中Closeable