Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HttpClient httpclient = new DefaultHttpClient();
- HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php");
- try {
- List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
- nameValuePairs.add(new BasicNameValuePair("username", "UserOne"));
- nameValuePairs.add(new BasicNameValuePair("password", "12345"));
- httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
- HttpResponse response = httpclient.execute(httppost);
- } catch (ClientProtocolException e) {
- // TODO Auto-generated catch block
- } catch (IOException e) {
- // TODO Auto-generated catch block
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement