接口 ServerHttpResponse

所有超级接口:
HttpMessage, ReactiveHttpOutputMessage
所有已知实现类:
AbstractListenerServerHttpResponse, AbstractServerHttpResponse, HttpHeadResponseDecorator, JettyHttpHandlerAdapter.Jetty12ServerHttpResponse, ReactorNetty2ServerHttpResponse, ReactorServerHttpResponse, ServerHttpResponseDecorator, ServletServerHttpResponse, TomcatHttpHandlerAdapter.TomcatServerHttpResponse, UndertowServerHttpResponse

public interface ServerHttpResponse extends ReactiveHttpOutputMessage
Represents a reactive server-side HTTP response.
从以下版本开始:
4.0
作者:
Arjen Poutsma, Sebastien Deleuze, Rossen Stoyanchev
  • 方法详细资料

    • setStatusCode

      boolean setStatusCode(@Nullable HttpStatus status)
      Set the HTTP status code of the response.
      参数:
      status - the HTTP status as an HttpStatus enum value
      返回:
      false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.
    • getStatusCode

      @Nullable HttpStatusCode getStatusCode()
      Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may be null if the status code value is outside the HttpStatus enum range, or if there is no default value from the underlying server.
    • setRawStatusCode

      default boolean setRawStatusCode(@Nullable Integer value)
      Set the HTTP status code to the given value (potentially non-standard and not resolvable through the HttpStatus enum) as an integer.
      参数:
      value - the status code value
      返回:
      false if the status code change wasn't processed because the HTTP response is committed, true if successfully set.
    • getRawStatusCode

      @Nullable default Integer getRawStatusCode()
      Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may be null if there is no default value from the underlying server.
    • getCookies

      cn.taketoday.util.MultiValueMap<String,ResponseCookie> getCookies()
      Return a mutable map with the cookies to send to the server.
    • addCookie

      void addCookie(ResponseCookie cookie)
      Add the given ResponseCookie.
      参数:
      cookie - the cookie to add
      抛出:
      IllegalStateException - if the response has already been committed