Class HttpHeadResponseDecorator
- java.lang.Object
- org.springframework.http.server.reactive.ServerHttpResponseDecorator
- org.springframework.http.server.reactive.HttpHeadResponseDecorator
- All Implemented Interfaces:
HttpMessage
,ReactiveHttpOutputMessage
,ServerHttpResponse
public class HttpHeadResponseDecorator extends ServerHttpResponseDecorator
ServerHttpResponse
decorator for HTTP HEAD requests.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description HttpHeadResponseDecorator(ServerHttpResponse delegate)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Void>
writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
InvokeServerHttpResponseDecorator.setComplete()
without writing.reactor.core.publisher.Mono<Void>
writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
Consume and release the body without writing.Methods inherited from class org.springframework.http.server.reactive.ServerHttpResponseDecorator
addCookie, beforeCommit, bufferFactory, getCookies, getDelegate, getHeaders, getStatusCode, isCommitted, setComplete, setStatusCode, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.http.server.reactive.ServerHttpResponse
getRawStatusCode, setRawStatusCode
Constructor Detail
HttpHeadResponseDecorator
public HttpHeadResponseDecorator(ServerHttpResponse delegate)
Method Detail
writeWith
public final reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
Consume and release the body without writing.If the headers contain neither Content-Length nor Transfer-Encoding, count the bytes and set Content-Length.
- Specified by:
writeWith
in interfaceReactiveHttpOutputMessage
- Overrides:
writeWith
in classServerHttpResponseDecorator
- Parameters:
body
- the body content publisher- Returns:
- a
Mono
that indicates completion or error
writeAndFlushWith
public final reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
InvokeServerHttpResponseDecorator.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.
- Specified by:
writeAndFlushWith
in interfaceReactiveHttpOutputMessage
- Overrides:
writeAndFlushWith
in classServerHttpResponseDecorator
- Parameters:
body
- the body content publisher- Returns:
- a
Mono
that indicates completion or error