接口 ServerHttpResponse
- 所有超级接口:
HttpMessage,ReactiveHttpOutputMessage
- 所有已知实现类:
AbstractListenerServerHttpResponse,AbstractServerHttpResponse,HttpHeadResponseDecorator,JettyHttpHandlerAdapter.Jetty12ServerHttpResponse,ReactorNetty2ServerHttpResponse,ReactorServerHttpResponse,ServerHttpResponseDecorator,ServletServerHttpResponse,TomcatHttpHandlerAdapter.TomcatServerHttpResponse,UndertowServerHttpResponse
Represents a reactive server-side HTTP response.
- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Sebastien Deleuze, Rossen Stoyanchev
-
方法概要
修饰符和类型方法说明voidaddCookie(ResponseCookie cookie) Add the givenResponseCookie.cn.taketoday.util.MultiValueMap<String,ResponseCookie> Return a mutable map with the cookies to send to the server.default IntegerReturn the status code that has been set, or otherwise fall back on the status of the response from the underlying server.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.default booleansetRawStatusCode(Integer value) Set the HTTP status code to the given value (potentially non-standard and not resolvable through theHttpStatusenum) as an integer.booleansetStatusCode(HttpStatus status) Set the HTTP status code of the response.从接口继承的方法 cn.taketoday.http.HttpMessage
getHeaders从接口继承的方法 cn.taketoday.http.ReactiveHttpOutputMessage
beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith
-
方法详细资料
-
setStatusCode
Set the HTTP status code of the response.- 参数:
status- the HTTP status as anHttpStatusenum value- 返回:
falseif the status code change wasn't processed because the HTTP response is committed,trueif successfully set.
-
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 benullif the status code value is outside theHttpStatusenum range, or if there is no default value from the underlying server. -
setRawStatusCode
Set the HTTP status code to the given value (potentially non-standard and not resolvable through theHttpStatusenum) as an integer.- 参数:
value- the status code value- 返回:
falseif the status code change wasn't processed because the HTTP response is committed,trueif successfully set.
-
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 benullif 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
Add the givenResponseCookie.- 参数:
cookie- the cookie to add- 抛出:
IllegalStateException- if the response has already been committed
-