title: Using CloseableHttpClient with try-with-resources
body: <p>I've been searching for a completed example of <code>CloseableHttpClient</code> with try-with-resources. I am confused on if closing <code>CloseableHttpClient</code> also closes the <code>CloseableHttpResponse</code> object that will be created when I call <code>httpclient.execute(post)</code>. Do I need to wrap <code>CloseableHttpResponse</code> in a try-with-resources too?</p>
  
  <p>Example:</p>
  
  <pre><code>try(CloseableHttpClient httpclient = HttpClients.custom().build()) {
      HttpPost post = new HttpPost(url);
      CloseableHttpResponse res = httpclient.execute(post);
  
      // do something with res
  } catch (Throwable e) {
      // do something with error
  }
  </code></pre>