Interface ClientHttpConnector
- All Known Implementing Classes:
HttpHandlerConnector,JettyClientHttpConnector,ReactorClientHttpConnector
public interface ClientHttpConnector
Abstraction over HTTP clients driving the underlying HTTP client to connect to the origin server and provide all necessary infrastructure to send aClientHttpRequestand receive aClientHttpResponse.- Since:
- 5.0
- Author:
- Brian Clozel
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<ClientHttpResponse>connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest,reactor.core.publisher.Mono<Void>> requestCallback)Connect to the origin server using the givenHttpMethodandURIand apply the givenrequestCallbackwhen the HTTP request of the underlying API can be initialized and written to.
Method Detail
connect
reactor.core.publisher.Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest,reactor.core.publisher.Mono<Void>> requestCallback)
Connect to the origin server using the givenHttpMethodandURIand apply the givenrequestCallbackwhen the HTTP request of the underlying API can be initialized and written to.- Parameters:
method- the HTTP request methoduri- the HTTP request URIrequestCallback- a function that prepares and writes to the request, returning a publisher that signals when it's done writing. Implementations can return aMono<Void>by callingReactiveHttpOutputMessage.writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>)orReactiveHttpOutputMessage.setComplete().- Returns:
- publisher for the
ClientHttpResponse