title: "401 Unauthorized" error while doing http post (cloned from curl command) in Android
body: <p>i know that i'm not first, but i did search and didn't found solution.
  First of all i need to make this:</p>
  <pre><code>curl -user1:pass1 - X POST -d&quot;data&quot; http://www.mysite.com/pushes.xml
  </code></pre>
  <p>But i don't want to use curl lib for such easy request, beacuse i think that solution must be easy and painless. I've found this <a href="http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java" rel="nofollow noreferrer">http login example</a>, and tried to use it with</p>
  <pre><code>    nvps.add(new BasicNameValuePair(&quot;username&quot;, &quot;user1&quot;));
      nvps.add(new BasicNameValuePair(&quot;password&quot;, &quot;pass1&quot;));
  </code></pre>
  <p>But i think that tags &quot;username&quot; and &quot;password&quot; are wrong... and i just unable to get them.. so I ask you about help. Please help me to understand what i need to do to get thrrough this login. Thanks will be guaranteed :)</p>
  <p>P.S. in the response i get msg &quot;HTTP Basic: Access denied&quot;. But curl command works fine...</p>