I\'m using apache httpclient 4.4 to do https requests, and I can constantly to see org.apache.http.NoHttpResponseException
.
Here\'s my code to create the h
Another way around this issue is to configure your org.apache.http.impl.client.AbstractHttpClient httpClient
to never reuse connections:
httpClient.setReuseStrategy(new NoConnectionReuseStrategy());
The same can be configured on a org.apache.http.impl.client.HttpClientBuilder builder
:
builder.setConnectionReuseStrategy(new NoConnectionReuseStrategy());
Finally figured it out on my own. If the previous response gives header, "connections=close", next request always gets this exception. So, when seeing this header, put 2 more lines
conManager.closeExpiredConnections();
conManager.closeIdleConnections(0, TimeUnit.SECONDS);
to let connection manager close the connection so that the connection won't be used by the next request.