Thursday, February 28th, 2013 at
9:46 am
public void postData() {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(“http://www.yoursite.com/script.php”);
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair(“id”, “12345″));
nameValuePairs.add(new BasicNameValuePair(“stringdata”, “AndDev is Cool!”));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
}
catch (ClientProtocolException e) {
// TODO Auto-generated catch block
}
catch (IOException e) {
// TODO Auto-generated catch block
}
}
Incoming search terms:
- arduino http post example
- arduino httpclient post
- arduino post request
- cocos2dx httpclient php
- how to create news HttpPost HttpClient
- how to make http client in ios
- httpclient arduino
- httpclient put request arduino
- httpclient to post data with captcha