title: Library for Android httpPost
body: <p>It's kinda frustating me... I tried to create httpPost 
  code : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>private void makePostRequest() {
  
  
          HttpClient httpClient = new DefaultHttpClient();
          // replace with your url
          HttpPost httpPost = new HttpPost("www.example.com");
  
  
          //Post Data
          List&lt;NameValuePair&gt; nameValuePair = new ArrayList&lt;NameValuePair&gt;(2);
          nameValuePair.add(new BasicNameValuePair("username", "test_user"));
          nameValuePair.add(new BasicNameValuePair("password", "123456789"));
  
  
          //Encoding POST data
          try {
              httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
          } catch (UnsupportedEncodingException e) {
              // log exception
              e.printStackTrace();
          }
  
          //making POST request.
          try {
              HttpResponse response = httpClient.execute(httpPost);
              // write response to log
              Log.d("Http Post Response:", response.toString());
          } catch (ClientProtocolException e) {
              // Log exception
              e.printStackTrace();
          } catch (IOException e) {
              // Log exception
              e.printStackTrace();
          }
  
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But always ended Can't resolve symbol. I used Android Studio latest update, I already downloaded <a href="http://mirror.metrocast.net/apache//httpcomponents/httpclient/binary/httpcomponents-client-4.5-bin.zip" rel="nofollow">http://mirror.metrocast.net/apache//httpcomponents/httpclient/binary/httpcomponents-client-4.5-bin.zip</a> from hc.apache.org and copy jar file (httpclient-4.5.jar and httpcore-4.4.1.jar) to library and add it as a library but somehow it doesn't work.</p>
  
  <p>It gives error :</p>
  
  <blockquote>
    <blockquote>
      <p>Error:Execution failed for task ':app:packageDebug'.
      Duplicate files copied in APK META-INF/DEPENDENCIES     File 1: Z:\Learning\Android-2\Live-code-AS\SendLocation\app\libs\httpcore-4.4.1.jar
        File 2:
      Z:\Learning\Android-2\Live-code-AS\SendLocation\app\libs\httpclient-4.5.jar</p>
    </blockquote>
  </blockquote>
  
  <p>if I delete one of the jar file then I'll get "can't resolve HttpClient or NameValuePair"</p>
  
  <p>Please help.... Thanks before.</p>