Class CachedBodyOutputMessage

  • All Implemented Interfaces:
    org.springframework.http.HttpMessage, org.springframework.http.ReactiveHttpOutputMessage

    public class CachedBodyOutputMessage
    extends Object
    implements org.springframework.http.ReactiveHttpOutputMessage
    Implementation of ClientHttpRequest that saves body as a field.
    • Constructor Detail

      • CachedBodyOutputMessage

        public CachedBodyOutputMessage​(org.springframework.web.server.ServerWebExchange exchange,
                                       org.springframework.http.HttpHeaders httpHeaders)
    • Method Detail

      • beforeCommit

        public void beforeCommit​(Supplier<? extends reactor.core.publisher.Mono<Void>> action)
        Specified by:
        beforeCommit in interface org.springframework.http.ReactiveHttpOutputMessage
      • isCommitted

        public boolean isCommitted()
        Specified by:
        isCommitted in interface org.springframework.http.ReactiveHttpOutputMessage
      • getHeaders

        public org.springframework.http.HttpHeaders getHeaders()
        Specified by:
        getHeaders in interface org.springframework.http.HttpMessage
      • bufferFactory

        public org.springframework.core.io.buffer.DataBufferFactory bufferFactory()
        Specified by:
        bufferFactory in interface org.springframework.http.ReactiveHttpOutputMessage
      • getBody

        public 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.
        Returns:
        body as Flux
      • writeWith

        public reactor.core.publisher.Mono<Void> writeWith​(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer> body)
        Specified by:
        writeWith in interface org.springframework.http.ReactiveHttpOutputMessage
      • writeAndFlushWith

        public reactor.core.publisher.Mono<Void> writeAndFlushWith​(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>> body)
        Specified by:
        writeAndFlushWith in interface org.springframework.http.ReactiveHttpOutputMessage
      • setComplete

        public reactor.core.publisher.Mono<Void> setComplete()
        Specified by:
        setComplete in interface org.springframework.http.ReactiveHttpOutputMessage