title: Why am I getting Http/1.1 400 Bad request?
body: <p>Here is a snippet of my code. I am trying to login to the website using HTTPOST.</p>
  <p>I keep getting &quot;400 Bad Request&quot; I have tried various combinations. I tried passing username/password as header instead of NameValuePair. But same result.
  Is there something I am missing?</p>
  <pre><code>HttpClient httpclient = new DefaultHttpClient();
          
  HttpPost post = new HttpPost(&quot;https://identi.ca/main/login&quot;);
      
  
  List &lt;NameValuePair&gt; nvps = new ArrayList &lt;NameValuePair&gt;();
  nvps.add(new BasicNameValuePair(&quot;nickname&quot;, u));
  nvps.add(new BasicNameValuePair(&quot;password&quot;, p));
  nvps.add(new BasicNameValuePair(&quot;submit&quot;, &quot;Login&quot;));
  
  post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
  
  HttpResponse response = httpclient.execute(post);
  HttpEntity entity = response.getEntity();
  
  Log.i(&quot;Login form POST result: &quot;, response.getStatusLine().toString());
          
  </code></pre>
  <p>Thanks for help.</p>