类 HttpHeadResponseDecorator

java.lang.Object
cn.taketoday.http.server.reactive.ServerHttpResponseDecorator
cn.taketoday.http.server.reactive.HttpHeadResponseDecorator
所有已实现的接口:
HttpMessage, ReactiveHttpOutputMessage, ServerHttpResponse

public class HttpHeadResponseDecorator extends ServerHttpResponseDecorator
ServerHttpResponse decorator for HTTP HEAD requests.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 构造器详细资料

    • HttpHeadResponseDecorator

      public HttpHeadResponseDecorator(ServerHttpResponse delegate)
  • 方法详细资料

    • writeWith

      public final reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> body)
      Consume and release the body without writing.

      If the headers contain neither Content-Length nor Transfer-Encoding, and the body is a Mono, count the bytes and set Content-Length.

      指定者:
      writeWith 在接口中 ReactiveHttpOutputMessage
      覆盖:
      writeWith 在类中 ServerHttpResponseDecorator
      参数:
      body - the body content publisher
      返回:
      a Mono that indicates completion or error
    • shouldSetContentLength

      private boolean shouldSetContentLength()
    • writeAndFlushWith

      public final reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> body)
      Invoke ServerHttpResponseDecorator.setComplete() without writing.

      RFC 7302 allows HTTP HEAD response without content-length and it's not something that can be computed on a streaming response.

      指定者:
      writeAndFlushWith 在接口中 ReactiveHttpOutputMessage
      覆盖:
      writeAndFlushWith 在类中 ServerHttpResponseDecorator
      参数:
      body - the body content publisher
      返回:
      a Mono that indicates completion or error