类 DelegatingServerHttpResponse
java.lang.Object
cn.taketoday.http.server.DelegatingServerHttpResponse
- 所有已实现的接口:
HttpMessage,HttpOutputMessage,ServerHttpResponse,Closeable,Flushable,AutoCloseable
Implementation of
ServerHttpResponse that delegates all calls to a
given target ServerHttpResponse.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a newDelegatingServerHttpResponse. -
方法概要
修饰符和类型方法说明voidclose()Close this response, freeing any resources created.voidflush()Ensure that the headers and the content of the response are written out.getBody()Return the body of the message as an output stream.Returns the target response that this response delegates to.Return the headers of this message.voidsetStatusCode(HttpStatusCode status) Set the HTTP status code of the response.
-
字段详细资料
-
delegate
-
-
构造器详细资料
-
DelegatingServerHttpResponse
Create a newDelegatingServerHttpResponse.- 参数:
delegate- the response to delegate to
-
-
方法详细资料
-
getDelegate
Returns the target response that this response delegates to.- 返回:
- the delegate
-
setStatusCode
从接口复制的说明:ServerHttpResponseSet the HTTP status code of the response.- 指定者:
setStatusCode在接口中ServerHttpResponse- 参数:
status- the HTTP status as an HttpStatus enum value
-
flush
从接口复制的说明:ServerHttpResponseEnsure 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- 指定者:
flush在接口中ServerHttpResponse- 抛出:
IOException
-
close
public void close()从接口复制的说明:ServerHttpResponseClose this response, freeing any resources created.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在接口中ServerHttpResponse
-
getBody
从接口复制的说明:HttpOutputMessageReturn the body of the message as an output stream.- 指定者:
getBody在接口中HttpOutputMessage- 返回:
- the output stream body (never
null) - 抛出:
IOException- in case of I/O errors
-
getHeaders
从接口复制的说明:HttpMessageReturn the headers of this message.- 指定者:
getHeaders在接口中HttpMessage- 返回:
- a corresponding HttpHeaders object (never
null)
-