title: Deprecated Java HttpClient - How hard can it be?
body: <p>All I'm trying to do is download some JSON and deserialize it into an object. I haven't got as far as downloading the JSON yet.</p>
  
  <p>Almost every single HttpClient example I can find, including those on the apache site looks something like...</p>
  
  <pre><code>import org.apache.http.client.HttpClient;
  import org.apache.http.impl.client.DefaultHttpClient;
  
  public void blah() {
      HttpClient client = new DefaultHttpClient();
      ...
  }
  </code></pre>
  
  <p>However, Netbeans tells me that <code>DefaultHttpClient</code> is deprecated. I've tried googling for <code>DefaultHttpClient deprecated</code> and as many other variations as I can think of and can't find any useful results, so I'm obviously missing something.</p>
  
  <p>What is the correct Java7 way to download the contents of a webpage? Is there really no decent Http Client as part of the language? I find that hard to believe.</p>
  
  <p>My Maven dependency for this is...</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
      &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
      &lt;version&gt;LATEST&lt;/version&gt;
      &lt;type&gt;jar&lt;/type&gt;
  &lt;/dependency&gt;
  </code></pre>