接口 ServerHttpResponse

所有超级接口:
AutoCloseable, Closeable, Flushable, HttpMessage, HttpOutputMessage
所有已知实现类:
DelegatingServerHttpResponse, RequestContext.RequestContextHttpOutputMessage, ServletServerHttpResponse

public interface ServerHttpResponse extends HttpOutputMessage, Flushable, Closeable
Represents a server-side HTTP response.
从以下版本开始:
3.0
作者:
Arjen Poutsma
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Close this response, freeing any resources created.
    void
    Ensure that the headers and the content of the response are written out.
    void
    Set the HTTP status code of the response.

    从接口继承的方法 cn.taketoday.http.HttpMessage

    getHeaders

    从接口继承的方法 cn.taketoday.http.HttpOutputMessage

    getBody
  • 方法详细资料

    • setStatusCode

      void setStatusCode(HttpStatusCode 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