public class ClientHttpRequestDecorator extends java.lang.Object implements ClientHttpRequest
ClientHttpRequest and delegates all methods to it.
Sub-classes can override specific methods selectively.| Constructor and Description |
|---|
ClientHttpRequestDecorator(ClientHttpRequest delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeCommit(java.util.function.Supplier<? extends reactor.core.publisher.Mono<java.lang.Void>> action)
Register an action to apply just before the HttpOutputMessage is committed.
|
DataBufferFactory |
bufferFactory()
Return a
DataBufferFactory that can be used to create the body. |
MultiValueMap<java.lang.String,HttpCookie> |
getCookies()
Return a mutable map of request cookies to send to the server.
|
ClientHttpRequest |
getDelegate() |
HttpHeaders |
getHeaders()
Return the headers of this message.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
java.net.URI |
getURI()
Return the URI of the request.
|
boolean |
isCommitted()
Whether the HttpOutputMessage is committed.
|
reactor.core.publisher.Mono<java.lang.Void> |
setComplete()
Indicate that message handling is complete, allowing for any cleanup or
end-of-processing tasks to be performed such as applying header changes
made via
HttpMessage.getHeaders() to the underlying HTTP message (if not
applied already). |
java.lang.String |
toString() |
reactor.core.publisher.Mono<java.lang.Void> |
writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
Use the given
Publisher of Publishers to write the body
of the HttpOutputMessage to the underlying HTTP layer, flushing after
each Publisher<DataBuffer>. |
reactor.core.publisher.Mono<java.lang.Void> |
writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
Use the given
Publisher to write the body of the message to the
underlying HTTP layer. |
public ClientHttpRequestDecorator(ClientHttpRequest delegate)
public ClientHttpRequest getDelegate()
public HttpMethod getMethod()
ClientHttpRequestgetMethod in interface ClientHttpRequestpublic java.net.URI getURI()
ClientHttpRequestgetURI in interface ClientHttpRequestpublic HttpHeaders getHeaders()
HttpMessagegetHeaders in interface HttpMessagenull)public MultiValueMap<java.lang.String,HttpCookie> getCookies()
ClientHttpRequestgetCookies in interface ClientHttpRequestpublic DataBufferFactory bufferFactory()
ReactiveHttpOutputMessageDataBufferFactory that can be used to create the body.bufferFactory in interface ReactiveHttpOutputMessageReactiveHttpOutputMessage.writeWith(Publisher)public void beforeCommit(java.util.function.Supplier<? extends reactor.core.publisher.Mono<java.lang.Void>> action)
ReactiveHttpOutputMessageNote: the supplied action must be properly deferred,
e.g. via Mono.defer(java.util.function.Supplier<? extends reactor.core.publisher.Mono<? extends T>>) or Mono.fromRunnable(java.lang.Runnable), to ensure it's
executed in the right order, relative to other actions.
beforeCommit in interface ReactiveHttpOutputMessageaction - the action to applypublic boolean isCommitted()
ReactiveHttpOutputMessageisCommitted in interface ReactiveHttpOutputMessagepublic reactor.core.publisher.Mono<java.lang.Void> writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
ReactiveHttpOutputMessagePublisher to write the body of the message to the
underlying HTTP layer.writeWith in interface ReactiveHttpOutputMessagebody - the body content publisherMono that indicates completion or errorpublic reactor.core.publisher.Mono<java.lang.Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
ReactiveHttpOutputMessagePublisher of Publishers to write the body
of the HttpOutputMessage to the underlying HTTP layer, flushing after
each Publisher<DataBuffer>.writeAndFlushWith in interface ReactiveHttpOutputMessagebody - the body content publisherMono that indicates completion or errorpublic reactor.core.publisher.Mono<java.lang.Void> setComplete()
ReactiveHttpOutputMessageHttpMessage.getHeaders() to the underlying HTTP message (if not
applied already).
This method should be automatically invoked at the end of message processing so typically applications should not have to invoke it. If invoked multiple times it should have no side effects.
setComplete in interface ReactiveHttpOutputMessageMono that indicates completion or errorpublic java.lang.String toString()
toString in class java.lang.Object