Search in sources :

Example 1 with BasicRequestProducer

use of org.apache.hc.core5.http.nio.support.BasicRequestProducer in project spring-framework by spring-projects.

the class HttpComponentsClientHttpRequest method toRequestProducer.

public AsyncRequestProducer toRequestProducer() {
    ReactiveEntityProducer reactiveEntityProducer = null;
    if (this.byteBufferFlux != null) {
        String contentEncoding = getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING);
        ContentType contentType = null;
        if (getHeaders().getContentType() != null) {
            contentType = ContentType.parse(getHeaders().getContentType().toString());
        }
        reactiveEntityProducer = new ReactiveEntityProducer(this.byteBufferFlux, this.contentLength, contentType, contentEncoding);
    }
    return new BasicRequestProducer(this.httpRequest, reactiveEntityProducer);
}
Also used : ReactiveEntityProducer(org.apache.hc.core5.reactive.ReactiveEntityProducer) ContentType(org.apache.hc.core5.http.ContentType) BasicRequestProducer(org.apache.hc.core5.http.nio.support.BasicRequestProducer)

Aggregations

ContentType (org.apache.hc.core5.http.ContentType)1 BasicRequestProducer (org.apache.hc.core5.http.nio.support.BasicRequestProducer)1 ReactiveEntityProducer (org.apache.hc.core5.reactive.ReactiveEntityProducer)1