Top Description Constructors Methods
org.springframework.http.server.reactive

public Class HttpHeadResponseDecorator

extends ServerHttpResponseDecorator
Class Inheritance
Imports
org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, org.springframework.core.io.buffer.DataBuffer, .DataBufferUtils, org.springframework.http.HttpHeaders

ServerHttpResponse decorator for HTTP HEAD requests.
Author
Rossen Stoyanchev
Since
5.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
public final Mono<Void>
public final Mono<Void>
writeWith(Publisher<? extends DataBuffer>
the body content publisher
body
)

Overrides org.springframework.http.server.reactive.ServerHttpResponseDecorator.writeWith.

Implements org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Consume and release the body without writing.
Inherited from org.springframework.http.server.reactive.ServerHttpResponseDecorator:
addCookiebeforeCommitbufferFactorygetCookiesgetDelegategetHeadersgetNativeResponsegetRawStatusCodegetStatusCodeisCommittedsetCompletesetRawStatusCodesetStatusCodetoString

Constructor Detail

HttpHeadResponseDecoratorback to summary
public HttpHeadResponseDecorator(ServerHttpResponse delegate)

Method Detail

shouldSetContentLengthback to summary
private boolean shouldSetContentLength()
writeAndFlushWithback to summary
public final Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body)

Overrides org.springframework.http.server.reactive.ServerHttpResponseDecorator.writeAndFlushWith.

Implements org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Invoke 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.

Parameters
body:Publisher<? extends Publisher<? extends DataBuffer>>

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

the body content publisher

Returns:Mono<Void>

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

a Mono that indicates completion or error

Annotations
@Override
writeWithback to summary
public final Mono<Void> writeWith(Publisher<? extends DataBuffer> body)

Overrides org.springframework.http.server.reactive.ServerHttpResponseDecorator.writeWith.

Implements org.springframework.http.ReactiveHttpOutputMessage.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.

Parameters
body:Publisher<? extends DataBuffer>

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeWith.

the body content publisher

Returns:Mono<Void>

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeWith.

a Mono that indicates completion or error

Annotations
@Override
@SuppressWarnings:unchecked