yaml
httpClient:
connectTimeout: 5000
readTimeout: 10000
maxConnections: 100
userAgent: "MyApp/1.0"
HttpClient client = new HttpClientBuilder(environment)
.using(configuration.getHttpClientConfiguration())
.build("my-client");
HttpResponse<String> response = client.target("http://api.example.com")
.request()
.get(String.class);
client.target("http://api.example.com")
.request()
.async()
.get(new InvocationCallback<HttpResponse<String>>() {
@Override
public void completed(HttpResponse<String> response) {
}
@Override
public void failed(Throwable throwable) {
}
});