Top Description Fields Constructors Methods
org.springframework.http.client.reactive

pack-priv Class HttpComponentsClientHttpRequest

extends AbstractClientHttpRequest
Class Inheritance
Imports
java.net.URI, .URISyntaxException, java.nio.ByteBuffer, java.util.Collection, java.util.function.Function, org.apache.hc.client5.http.cookie.CookieStore, org.apache.hc.client5.http.impl.cookie.BasicClientCookie, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.http.ContentType, .HttpRequest, org.apache.hc.core5.http.message.BasicHttpRequest, org.apache.hc.core5.http.nio.AsyncRequestProducer, org.apache.hc.core5.http.nio.support.BasicRequestProducer, org.apache.hc.core5.reactive.ReactiveEntityProducer, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, org.springframework.core.io.buffer.DataBuffer, .DataBufferFactory, org.springframework.http.HttpHeaders, .HttpMethod, .MediaType, org.springframework.http.support.HttpComponentsHeadersAdapter, org.springframework.lang.Nullable

ClientHttpRequest implementation for the Apache HttpComponents HttpClient 5.x.
Authors
Martin Tarjányi, Arjen Poutsma
Since
5.3
See Also
Apache HttpComponents

Field Summary

Modifier and TypeField and Description
private Flux<ByteBuffer>
private transient long
private final HttpClientContext
private final DataBufferFactory
private final HttpRequest

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
applyCookies()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyCookies.

Add cookies from getHeaders() to the underlying request.
protected void
applyHeaders()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyHeaders.

Apply header changes from getHeaders() to the underlying request.
public DataBufferFactory
public HttpMethod
getMethod()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getMethod.

Return the HTTP method of the request.
public <T> T
getNativeRequest()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getNativeRequest.

Return the request from the underlying HTTP library.
public URI
protected HttpHeaders
initReadOnlyHeaders()

Overrides org.springframework.http.client.reactive.AbstractClientHttpRequest.initReadOnlyHeaders.

Initialize the read-only headers after the request is committed.
public Mono<Void>
setComplete()

Implements org.springframework.http.ReactiveHttpOutputMessage.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 getHeaders() to the underlying HTTP message (if not applied already).
public AsyncRequestProducer
public Mono<Void>
writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>>
the body content publisher
body
)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Use the given Publisher of Publishers to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after each Publisher<DataBuffer>.
public Mono<Void>
writeWith(Publisher<? extends DataBuffer>
the body content publisher
body
)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Use the given Publisher to write the body of the message to the underlying HTTP layer.
Inherited from org.springframework.http.client.reactive.AbstractClientHttpRequest:
beforeCommitdoCommitdoCommitgetCookiesgetHeadersisCommitted

Field Detail

byteBufferFluxback to summary
private Flux<ByteBuffer> byteBufferFlux
Annotations
@Nullable
contentLengthback to summary
private transient long contentLength
contextback to summary
private final HttpClientContext context
dataBufferFactoryback to summary
private final DataBufferFactory dataBufferFactory
httpRequestback to summary
private final HttpRequest httpRequest

Constructor Detail

HttpComponentsClientHttpRequestback to summary
public HttpComponentsClientHttpRequest(HttpMethod method, URI uri, HttpClientContext context, DataBufferFactory dataBufferFactory)

Method Detail

applyCookiesback to summary
protected void applyCookies()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyCookies.

Doc from org.springframework.http.client.reactive.AbstractClientHttpRequest.applyCookies.

Add cookies from getHeaders() to the underlying request. This method is called once only.

Annotations
@Override
applyHeadersback to summary
protected void applyHeaders()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyHeaders.

Doc from org.springframework.http.client.reactive.AbstractClientHttpRequest.applyHeaders.

Apply header changes from getHeaders() to the underlying request. This method is called once only.

Annotations
@Override
bufferFactoryback to summary
public DataBufferFactory bufferFactory()

Implements org.springframework.http.ReactiveHttpOutputMessage.bufferFactory.

Doc from org.springframework.http.ReactiveHttpOutputMessage.bufferFactory.

Return a DataBufferFactory that can be used to create the body.

Returns:DataBufferFactory

a buffer factory

Annotations
@Override
getMethodback to summary
public HttpMethod getMethod()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getMethod.

Doc from org.springframework.http.client.reactive.ClientHttpRequest.getMethod.

Return the HTTP method of the request.

Annotations
@Override
getNativeRequestback to summary
public <T> T getNativeRequest()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getNativeRequest.

Doc from org.springframework.http.client.reactive.ClientHttpRequest.getNativeRequest.

Return the request from the underlying HTTP library.

Parameters
<T>
the expected type of the request to cast to
Annotations
@Override
@SuppressWarnings:unchecked
getURIback to summary
public URI getURI()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getURI.

Doc from org.springframework.http.client.reactive.ClientHttpRequest.getURI.

Return the URI of the request.

Annotations
@Override
initReadOnlyHeadersback to summary
protected HttpHeaders initReadOnlyHeaders()

Overrides org.springframework.http.client.reactive.AbstractClientHttpRequest.initReadOnlyHeaders.

Doc from org.springframework.http.client.reactive.AbstractClientHttpRequest.initReadOnlyHeaders.

Initialize the read-only headers after the request is committed.

By default, this method simply applies a read-only wrapper. Subclasses can do the same for headers from the native request.

Annotations
@Override
setCompleteback to summary
public Mono<Void> setComplete()

Implements org.springframework.http.ReactiveHttpOutputMessage.setComplete.

Doc from org.springframework.http.ReactiveHttpOutputMessage.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 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.

Returns:Mono<Void>

a Mono that indicates completion or error

Annotations
@Override
toRequestProducerback to summary
public AsyncRequestProducer toRequestProducer()
writeAndFlushWithback to summary
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Use the given Publisher of Publishers to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after each Publisher<DataBuffer>.

Parameters
body:Publisher<? extends Publisher<? extends DataBuffer>>

the body content publisher

Returns:Mono<Void>

a Mono that indicates completion or error

Annotations
@Override
writeWithback to summary
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Use the given Publisher to write the body of the message to the underlying HTTP layer.

Parameters
body:Publisher<? extends DataBuffer>

the body content publisher

Returns:Mono<Void>

a Mono that indicates completion or error

Annotations
@Override