public class ReactorClientHttpRequest extends AbstractClientHttpRequest implements ZeroCopyHttpOutputMessage
ClientHttpRequest
implementation for the Reactor-Netty HTTP client.HttpClient
Constructor and Description |
---|
ReactorClientHttpRequest(HttpMethod httpMethod,
URI uri,
reactor.ipc.netty.http.client.HttpClientRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyCookies()
Add cookies from
AbstractClientHttpRequest.getHeaders() to the underlying response. |
protected void |
applyHeaders()
Apply header changes from
AbstractClientHttpRequest.getHeaders() to the underlying response. |
DataBufferFactory |
bufferFactory()
Return a
DataBufferFactory that can be used to create the body. |
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
URI |
getURI()
Return the URI of the request.
|
reactor.core.publisher.Mono<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). |
reactor.core.publisher.Mono<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<Void> |
writeWith(File file,
long position,
long count)
Use the given
File to write the body of the message to the underlying
HTTP layer. |
reactor.core.publisher.Mono<Void> |
writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
Use the given
Publisher to write the body of the message to the
underlying HTTP layer. |
beforeCommit, doCommit, doCommit, getCookies, getHeaders, isCommitted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beforeCommit, isCommitted
getHeaders
public ReactorClientHttpRequest(HttpMethod httpMethod, URI uri, reactor.ipc.netty.http.client.HttpClientRequest httpRequest)
public DataBufferFactory bufferFactory()
ReactiveHttpOutputMessage
DataBufferFactory
that can be used to create the body.bufferFactory
in interface ReactiveHttpOutputMessage
ReactiveHttpOutputMessage.writeWith(Publisher)
public HttpMethod getMethod()
ClientHttpRequest
getMethod
in interface ClientHttpRequest
public URI getURI()
ClientHttpRequest
getURI
in interface ClientHttpRequest
public reactor.core.publisher.Mono<Void> writeWith(org.reactivestreams.Publisher<? extends DataBuffer> body)
ReactiveHttpOutputMessage
Publisher
to write the body of the message to the
underlying HTTP layer.writeWith
in interface ReactiveHttpOutputMessage
body
- the body content publisherMono
that indicates completion or errorpublic reactor.core.publisher.Mono<Void> writeAndFlushWith(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
ReactiveHttpOutputMessage
Publisher
of Publishers
to write the body
of the HttpOutputMessage to the underlying HTTP layer, flushing after
each Publisher<DataBuffer>
.writeAndFlushWith
in interface ReactiveHttpOutputMessage
body
- the body content publisherMono
that indicates completion or errorpublic reactor.core.publisher.Mono<Void> writeWith(File file, long position, long count)
ZeroCopyHttpOutputMessage
File
to write the body of the message to the underlying
HTTP layer.writeWith
in interface ZeroCopyHttpOutputMessage
file
- the file to transferposition
- the position within the file from which the transfer is to begincount
- the number of bytes to be transferredpublic reactor.core.publisher.Mono<Void> setComplete()
ReactiveHttpOutputMessage
HttpMessage.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 ReactiveHttpOutputMessage
Mono
that indicates completion or errorprotected void applyHeaders()
AbstractClientHttpRequest
AbstractClientHttpRequest.getHeaders()
to the underlying response.
This method is called once only.applyHeaders
in class AbstractClientHttpRequest
protected void applyCookies()
AbstractClientHttpRequest
AbstractClientHttpRequest.getHeaders()
to the underlying response.
This method is called once only.applyCookies
in class AbstractClientHttpRequest