Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid HTTP request always returns code 404
    text
    copied!<p>I'm trying to implement a simple HTTP request. The request will verify a username and password from a server. The server is configured such that it will only return two error codes, 200 for verified and 404 for everything else. I've done extensive debugging with eclipse and found that I always receive code 404. I've read all other existing questions before posting this.</p> <pre><code>private class loginTask extends AsyncTask&lt;String, Integer, Boolean&gt; { String check; @Override protected Boolean doInBackground(String... arg0) { ("http://www.unite.upmc.edu/account/IPhoneLogin?username=username&amp;password=password String username = arg0[0]; String password = arg0[1]; URI uri = null; try { uri = new URI("http://unite.upmc.edu/account/IPhoneLogin?"+"username="+username+"&amp;"+"password="+password);// I know the method is called IPhoneLogin, it's being used by both Android and IOS clients } catch (URISyntaxException e1) { e1.printStackTrace(); } HttpClient client = new DefaultHttpClient(); try {//Look here HttpResponse response = client.execute(new HttpGet(uri)); String code = "" + response.getStatusLine().getStatusCode(); check = code; if(code.equals("200")){ loggedIn = true; }else{ //need to re-enter username and password } } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } hasPin = false; return true; } @Override protected void onProgressUpdate(Integer... integers) { setProgress(integers[0]); } @Override protected void onPreExecute() { ProgressDialog dialog = new ProgressDialog(UniteActivity.this); dialog.setMessage("Logging in...." + check); dialog.show(); } </code></pre> <p>I know the server is up and the password and username are correct because I've logged in normally many times using internet explorer. I'm using the eclipse IDE with Android SDK and am concerned this might be a product of the buggy emulator it provides. Any ideas on what I'm doing wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload