In advance to the default HttpClient the CloseableHttpClient returns a CloseableHttpResponse which can get auto closed in a try-catch block like
This should reduce errors in dealing with non-closed responses.
I’ve created a PR in
Needed to increase package version to 2.0.0
thanks - i've updated the PR to add new methods returning CloseableHttpClient interface instead of changing the existing ones. no need to break backward compatibility here, that complicates updating existing apps and systems.
i've also applied the same change to the http async client.