I have the following code:
HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(SERVERURI + "site.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("login", "Login")); nameValuePairs.add(new BasicNameValuePair("password", "Password")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8")); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); if (response.getStatusLine().getStatusCode() == 200) { HttpEntity entity = response.getEntity(); Everything works, but I really don’t like the fact that half of it is crossed out (deprecated). How can I fix this? (update)