I was looking for information on how I can send information using the HttpPost method on Android, and I always see this:
HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(posturl); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("Name","Var1")); params.add(new BasicNameValuePair("Name2","Var2")); httppost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse resp = httpclient.execute(httppost); HttpEntity ent = resp.getEntity();
The problem is that I cannot do this, because I need to connect to a resource that receives the String format with XML.
Any idea on how I can only send a string without using List<nameValuePair>
source share