title: Best practice to get json from url in api 23
body: <p>I'm using <code>compileSdk 23</code> with support library version 23.</p>
  
  <p>I've used httplegacy library (I've copied it into <em>app/libs</em> folder from <em>androidSdk/android-23/optional/org.apache.http.legacy.jar</em>) and in gradle I've put:</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
  }
  </code></pre>
  
  <p>In order to load that library.</p>
  
  <p>Into my Connection class I've got a method to load an instance of <code>DefaultHttpClient</code> in this way:</p>
  
  <pre><code>private static HttpClient getClient(){
      HttpParams httpParameters = new BasicHttpParams();
      int timeoutConnection = 3000;
      HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
      int timeoutSocket = 3000;
      HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
  
      DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);
  
      return httpClient;
  }
  </code></pre>
  
  <p>But Android Studio says me that all <code>apache.http</code> classes are deprecated.</p>
  
  <p>What could I use in order to follow best practice?</p>