Jon skeet said:
The documentation seems pretty clear to me: "Base implementation of HttpClient that also implements Closeable" - HttpClient is an interface; CloseableHttpClient is an abstract class, but because it implements AutoCloseable you can use it in a try-with-resources statement.
But then Jules asked:
@JonSkeet That much is clear, but how important is it to close HttpClient instances? If it's important, why is the close() method not part of the basic interface?
Answer for Jules
close need not be part of basic interface since underlying connection is released back to the connection manager automatically after every execute
To accommodate the try-with-resources statement. It is mandatory to implement Closeable. Hence included it in CloseableHttpClient.
Note:
close method in AbstractHttpClient which is extending CloseableHttpClient is deprecated, I was not able to find the source code for that.