I am attempting to use Apache's HttpClient 4.5.2. I am running on a Wildfly 10 server. I really would like to use org.apache.http.client.fluent.Request. The call works the first time. Here is what the code looks like
InputStream stream = null;
try {
Request httpGetRequest = Request.get(queryUrl);
httpGetRequest.viaProxy(new HttpHost(httpsProxyHost, httpProxyPort.intValue()));
HttpResponse response = httpGetRequest.execute().returnResponse();
stream = response.getEntity().getContent();
//Process Stream....
} catch (Exception e) {
logger.error("Nope!. Try again", e);
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (Exception e) {
logger.warn("Problem closing stream!", e);
}
}
Works the first time.. but the second time I get a Connection Timeout error..
Important to note: If not going thru the Proxy and Not using SSL (different url, but same code) it works everytime.
Any ideas?
thanks.