Class JettyClientHttpConnector
java.lang.Object
org.springframework.http.client.reactive.JettyClientHttpConnector
- All Implemented Interfaces:
- ClientHttpConnector
ClientHttpConnector for the Jetty Reactive Streams HttpClient.- Since:
- 5.1
- Author:
- Sebastien Deleuze
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor that creates a new instance ofHttpClient.JettyClientHttpConnector(org.eclipse.jetty.client.HttpClient httpClient) Constructor with an initializedHttpClient.JettyClientHttpConnector(org.eclipse.jetty.client.HttpClient httpClient, @Nullable JettyResourceFactory resourceFactory) Constructor with an initializedHttpClientand configures it with the givenJettyResourceFactory.
- 
Method SummaryModifier and TypeMethodDescriptionreactor.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.voidsetBufferFactory(JettyDataBufferFactory bufferFactory) Set the buffer factory to use.voidsetCookieParser(ResponseCookie.Parser parser) Customize the parsing of response cookies.
- 
Constructor Details- 
JettyClientHttpConnectorpublic JettyClientHttpConnector()Default constructor that creates a new instance ofHttpClient.
- 
JettyClientHttpConnectorpublic JettyClientHttpConnector(org.eclipse.jetty.client.HttpClient httpClient) Constructor with an initializedHttpClient.
- 
JettyClientHttpConnectorpublic JettyClientHttpConnector(org.eclipse.jetty.client.HttpClient httpClient, @Nullable JettyResourceFactory resourceFactory) Constructor with an initializedHttpClientand configures it with the givenJettyResourceFactory.- Parameters:
- httpClient- the- HttpClientto use
- resourceFactory- the- JettyResourceFactoryto use
- Since:
- 5.2
 
 
- 
- 
Method Details- 
setBufferFactorySet the buffer factory to use.
- 
setCookieParserCustomize the parsing of response cookies.By default, HttpCookie.parse(String)is used, and additionally the sameSite attribute is parsed and set.- Parameters:
- parser- the parser to use
- Since:
- 7.0
 
- 
connectpublic reactor.core.publisher.Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, reactor.core.publisher.Mono<Void>> requestCallback) Description copied from interface:ClientHttpConnectorConnect to the origin server using the givenHttpMethodandURIand apply the givenrequestCallbackwhen the HTTP request of the underlying API can be initialized and written to.- Specified by:
- connectin interface- ClientHttpConnector
- Parameters:
- method- the HTTP request method
- uri- the HTTP request URI
- requestCallback- 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- ReactiveHttpOutputMessage.writeWith(Publisher)or- ReactiveHttpOutputMessage.setComplete().
- Returns:
- publisher for the ClientHttpResponse
 
 
-