Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. HttpClient httpclient = new DefaultHttpClient();
  2. HttpPost httppost = new HttpPost("http://website.com/kundenexecute.php");
  3. httppost.addHeader("Content-type","application/x-www-form-urlencoded");
  4. //httppost.setHeader("Content-type:application/x-www-form-urlencoded");
  5. try {
  6. // Add your data
  7. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
  8. nameValuePairs.add(new BasicNameValuePair("id", "12345"));
  9. nameValuePairs.add(new BasicNameValuePair("stringdata", "Hi"));
  10. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  11.  
  12. // Execute HTTP Post Request
  13. HttpResponse response = httpclient.execute(httppost);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement