KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Here is a snippet of my code. I am trying to login to the website using HTTPOST. I keep getting "400 Bad Request" I have tried various combinations. I tried passing username/password as header instead of NameValuePair. But same result. Is there something I am missing? HttpClient httpclient = new DefaultHttpClient(); HttpPost post = new HttpPost("https://identi.ca/main/login"); List <NameValuePair> nvps = new ArrayList <NameValuePair>(); nvps.add(new BasicNameValuePair("nickname", u)); nvps.add(new BasicNameValuePair("password", p)); nvps.add(new BasicNameValuePair("submit", "Login")); post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); HttpResponse response = httpclient.execute(post); HttpEntity entity = response.getEntity(); Log.i("Login form POST result: ", response.getStatusLine().toString()); Thanks for help.
Tags (comma-separated)
Save Edits
Cancel