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

public Interface ClientHttpConnector

Known Direct Implementers
org.springframework.http.client.reactive.HttpComponentsClientHttpConnector, org.springframework.http.client.reactive.JdkClientHttpConnector, org.springframework.http.client.reactive.JettyClientHttpConnector, org.springframework.http.client.reactive.ReactorClientHttpConnector, org.springframework.http.client.reactive.ReactorNetty2ClientHttpConnector
Imports
java.net.URI, java.util.function.Function, reactor.core.publisher.Mono, org.springframework.http.HttpMethod

Abstraction over HTTP clients driving the underlying HTTP client to connect to the origin server and provide all necessary infrastructure to send a ClientHttpRequest and receive a ClientHttpResponse.
Author
Brian Clozel
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public Mono<ClientHttpResponse>

Returns:

publisher for the ClientHttpResponse
connect
(HttpMethod
the HTTP request method
method
,
URI
the HTTP request URI
uri
,
Function<? super ClientHttpRequest, Mono<Void>>
a function that prepares and writes to the request, returning a publisher that signals when it's done writing. Implementations can return a Mono<Void> by calling ClientHttpRequest#writeWith or ClientHttpRequest#setComplete.
requestCallback
)

Connect to the origin server using the given HttpMethod and URI and apply the given requestCallback when the HTTP request of the underlying API can be initialized and written to.

Method Detail

connectback to summary
public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, Mono<Void>> requestCallback)

Connect to the origin server using the given HttpMethod and URI and apply the given requestCallback when the HTTP request of the underlying API can be initialized and written to.

Parameters
method:HttpMethod

the HTTP request method

uri:URI

the HTTP request URI

requestCallback:Function<? super ClientHttpRequest, Mono<Void>>

a function that prepares and writes to the request, returning a publisher that signals when it's done writing. Implementations can return a Mono<Void> by calling ClientHttpRequest#writeWith or ClientHttpRequest#setComplete.

Returns:Mono<ClientHttpResponse>

publisher for the ClientHttpResponse