I have inherited the code
import org.apache.http.client.HttpClient;
...
HttpClient httpclient = createHttpClientOrProxy();
try {
HttpPost postR
Instead of creating a new instance of HttpClient
, use the Builder. You would get a CloseableHttpClient
.
e.g usage:
CloseableHttpClient httpClient = HttpClientBuilder.create().setProxy(proxy).build()
Instead of using getConnectionManager().shutdown()
, use the close()
method instead on CloseableHttpClient
.