public class ReactorClientHttpRequest extends AbstractClientHttpRequest
ClientHttpRequest
implementation for the Reactor-Netty HTTP client.reactor.ipc.netty.http.client.HttpClient
Modifier and Type | Field and Description |
---|---|
private NettyDataBufferFactory |
bufferFactory |
private HttpMethod |
httpMethod |
private HttpClientRequest |
httpRequest |
private java.net.URI |
uri |
Constructor and Description |
---|
ReactorClientHttpRequest(HttpMethod httpMethod,
java.net.URI uri,
HttpClientRequest httpRequest) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyCookies()
Implement this method to add cookies from
AbstractClientHttpRequest.getHeaders() to the
underlying response. |
protected void |
applyHeaders()
Implement this method to 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.
|
java.net.URI |
getURI()
Return the URI of the request.
|
<any> |
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). |
private static <any> |
toByteBufs(<any> dataBuffers) |
<any> |
writeAndFlushWith(<any> body)
Use the given
Publisher of Publishers to write the body
of the HttpOutputMessage to the underlying HTTP layer, flushing after
each Publisher<DataBuffer> . |
<any> |
writeWith(<any> body)
Use the given
Publisher to write the body of the message to the
underlying HTTP layer. |
beforeCommit, doCommit, doCommit, getCookies, getHeaders, isCommitted
private final HttpMethod httpMethod
private final java.net.URI uri
private final HttpClientRequest httpRequest
private final NettyDataBufferFactory bufferFactory
public ReactorClientHttpRequest(HttpMethod httpMethod, java.net.URI uri, HttpClientRequest httpRequest)
public DataBufferFactory bufferFactory()
ReactiveHttpOutputMessage
DataBufferFactory
that can be used to create the body.#writeWith(Publisher)
public HttpMethod getMethod()
ClientHttpRequest
public java.net.URI getURI()
ClientHttpRequest
public <any> writeWith(<any> body)
ReactiveHttpOutputMessage
Publisher
to write the body of the message to the
underlying HTTP layer.body
- the body content publisherMono
that indicates completion or errorpublic <any> writeAndFlushWith(<any> body)
ReactiveHttpOutputMessage
Publisher
of Publishers
to write the body
of the HttpOutputMessage to the underlying HTTP layer, flushing after
each Publisher<DataBuffer>
.body
- the body content publisherMono
that indicates completion or errorprivate static <any> toByteBufs(<any> dataBuffers)
public <any> 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.
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