Hi.
I ahve been trying to send a http POST message towards my server, I
have been using this code :

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(sUrl);

// Add your data
List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>(1);
String userAgent = Management.getInstance().getUserAgent();
nameValuePairs.add(new BasicNameValuePair("User-Agent",
"Test_User_Agent"));
nameValuePairs.add(new BasicNameValuePair("Data", data));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

Honestly, to me it all seems overly complicated....
To start off, how do I actually add a body (for example a custom XML)
to the post ?
Is the nameValuePairs the only option ? I'd like to ismply add a POST
body with data without having to "name" it with a key...
Any help or tips would be greatly appreciated...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to