Class HttpHeadResponseDecorator
java.lang.Object
org.springframework.http.server.reactive.ServerHttpResponseDecorator
org.springframework.http.server.reactive.HttpHeadResponseDecorator
- All Implemented Interfaces:
HttpMessage
,ReactiveHttpOutputMessage
,ServerHttpResponse
ServerHttpResponse
decorator for HTTP HEAD requests.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal reactor.core.publisher.Mono<Void>
writeAndFlushWith
(Publisher<? extends Publisher<? extends DataBuffer>> body) InvokeServerHttpResponseDecorator.setComplete()
without writing.final reactor.core.publisher.Mono<Void>
writeWith
(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, getNativeResponse, 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 Details
-
HttpHeadResponseDecorator
-
-
Method Details
-
writeWith
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.- 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(Publisher<? extends 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
-