title: With what can I replace http deprecated methods?
body: <p>I was following a tutorial and I got to a point where a lot of the code is deprecated.</p>
  
  <pre><code>ArrayList&lt;NameValuePair&gt; dataToSend = new ArrayList&lt;&gt;();
  dataToSend.add(new BasicNameValuePair("name", user.name));
  dataToSend.add(new BasicNameValuePair("age", user.age));
  
  HttpParams httpRequestParams = new BasicHttpParams();
  HttpConnectionParamas.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT);
  HttpConnectionParamas.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT);
  
  HttpClient client = new DefaultHttpClient(httpRequestParams);
  HttpPost post = new HttpPost(SERVER_ADDRESS + "Register.php");
  
  try{
      post.setEntity(new UrlEncodedFormEntity(dataToSend));
      client.execute(post);
  }catch (Exception e){
      e.printStackTrace();
  }
  </code></pre>
  
  <p>and another POST method that is returning a result </p>
  
  <pre><code>    HttpResponse httpResponse = client.execute(post);
  
      HttpEntity entity = httpResponse.getEntity();
      String result = EntityUtils.toString(entity);
      JSONObject jObject = new JSONObject(result);
  </code></pre>
  
  <p>I found that I can replace <code>NameValuePair</code> with </p>
  
  <pre><code>ContentValues values = new ContentValues();
  values.put("name", user.name);
  values.put("age", user.age + "");
  </code></pre>
  
  <p>but I have no idea about the others. </p>