public class CachedBodyOutputMessage extends Object implements org.springframework.http.ReactiveHttpOutputMessage
ClientHttpRequest.| Constructor and Description |
|---|
CachedBodyOutputMessage(org.springframework.web.server.ServerWebExchange exchange,
org.springframework.http.HttpHeaders httpHeaders) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action) |
org.springframework.core.io.buffer.DataBufferFactory |
bufferFactory() |
reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> |
getBody()
Return the request body, or an error stream if the body was never set
or when
setWriteHandler(java.util.function.Function<reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>, reactor.core.publisher.Mono<java.lang.Void>>) is configured. |
org.springframework.http.HttpHeaders |
getHeaders() |
boolean |
isCommitted() |
reactor.core.publisher.Mono<Void> |
setComplete() |
void |
setWriteHandler(Function<reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>,reactor.core.publisher.Mono<Void>> writeHandler)
Configure a custom handler for writing the request body.
|
reactor.core.publisher.Mono<Void> |
writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body) |
reactor.core.publisher.Mono<Void> |
writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body) |
public CachedBodyOutputMessage(org.springframework.web.server.ServerWebExchange exchange,
org.springframework.http.HttpHeaders httpHeaders)
public void beforeCommit(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
beforeCommit in interface org.springframework.http.ReactiveHttpOutputMessagepublic boolean isCommitted()
isCommitted in interface org.springframework.http.ReactiveHttpOutputMessagepublic org.springframework.http.HttpHeaders getHeaders()
getHeaders in interface org.springframework.http.HttpMessagepublic org.springframework.core.io.buffer.DataBufferFactory bufferFactory()
bufferFactory in interface org.springframework.http.ReactiveHttpOutputMessagepublic reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> getBody()
setWriteHandler(java.util.function.Function<reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>, reactor.core.publisher.Mono<java.lang.Void>>) is configured.public void setWriteHandler(Function<reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>,reactor.core.publisher.Mono<Void>> writeHandler)
The default write handler consumes and caches the request body so it may be accessed subsequently, e.g. in test assertions. Use this property when the request body is an infinite stream.
writeHandler - the write handler to use returning Mono<Void>
when the body has been "written" (i.e. consumed).public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)
writeWith in interface org.springframework.http.ReactiveHttpOutputMessagepublic reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)
writeAndFlushWith in interface org.springframework.http.ReactiveHttpOutputMessagepublic reactor.core.publisher.Mono<Void> setComplete()
setComplete in interface org.springframework.http.ReactiveHttpOutputMessageCopyright © 2019 Pivotal Software, Inc.. All rights reserved.