title: Android HttpPost and HttpClient Substitute
body: <p>Just a quick question.
  Until now I have been using HttpClient and HttpPost to post a file and some parameters to a php script on my server.
  However they have been deprecated.
  I was wondering what i could use to substitute it.
  I found some answers on other posts but unfortunately i didn't manage to integrate any of them with the HttpMime Library that i am using for a MultiPartEntity post.</p>
  
  <pre><code>            HttpClient httpclient = new DefaultHttpClient();        // Deprecated
          HttpPost httpost = new HttpPost(inData[0].URL);         // Deprecated
  
              // Request To Entity
          MultipartEntity entity = new MultipartEntity();
              // Add Parameters
          for(Request r : inData[0].Params)
              entity.addPart(r.Key, new StringBody(r.Body));
              // Add File
          entity.addPart("img", new FileBody(inData[0].FileToUpload));
  
          httpost.setEntity(entity);
  
          HttpResponse responsePOST = httpclient.execute(httpost);    // Deprecated
          HttpEntity resEntity = responsePOST.getEntity();            // Deprecated
          if (resEntity != null)
              inData[0].RequestResult.add(EntityUtils.toString(resEntity));
          else
              throw new Exception("");
          return inData[0];
  
      } catch (Exception e) {
          e.printStackTrace();
          inData[0].RequestResult.add("ERROR");
      }
      return inData[0];
  </code></pre>
  
  <p>Would anyone point me in the right direction? Thanks</p>