Guest User

Untitled

a guest
Aug 29th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. HttpClient httpclient = new DefaultHttpClient();
  2. HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php");
  3.  
  4. try {
  5. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
  6. nameValuePairs.add(new BasicNameValuePair("username", "UserOne"));
  7. nameValuePairs.add(new BasicNameValuePair("password", "12345"));
  8. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  9.  
  10. HttpResponse response = httpclient.execute(httppost);
  11.  
  12. } catch (ClientProtocolException e) {
  13. // TODO Auto-generated catch block
  14. } catch (IOException e) {
  15. // TODO Auto-generated catch block
  16. }
Add Comment
Please, Sign In to add comment