RequestHeaders header = RequestHeaders.of(HttpMethod.GET, endpoint, HttpHeaderNames.COOKIE,
cookieHeader);
WebClient.of(clientFactory(), hosturl)
.execute(header)
.aggregate()
.whenCompleteAsync((resp,cause)->{
if(cause != null) {
//TODO
}
else if(resp.status()==HttpStatus.OK) {
//TODO
}
else
{
//TODO
}
});
public static ClientFactory clientFactory() {
return ClientFactory.builder().sslContextCustomizer(b -> b.trustManager(InsecureTrustManagerFactory.INSTANCE))
.idleTimeout(Duration.ZERO).build();
}