Heads up! This post was written 12 years ago. Some information might be outdated or may have changed since then.
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(Baseurl + "/misc/send_contact_info");
List< NameValuePair > params = new ArrayList();
params.add(new BasicNameValuePair("message", "TEXT_TO_POST"));
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params, HTTP.UTF_8);
post.setEntity(ent);
HttpResponse responsePOST = client.execute(post);
HttpEntity resEntity = responsePOST.getEntity();
if (resEntity != null) {
String res = EntityUtils.toString(resEntity);
// резултат върнат от сървъра ?
} else {
// .... друг код ?!
} бързо и лесно :) Естествено че може да се направи и като функция с параметри и т.н :)