java - How to attach XML file in message body of HTTP post request? -


how attach xml file in message body of http post request?

can 1 give example kind

here sample code snippet making http post request on desired url:

try {   string myxml = "<? xml version=1.0> <request> <elemtnt> <data id=\"1\">e1203</data> <data id=\"2\">e1204</data> </element> </request>";  httpclient httpclient = new defaulthttpclient();  httpcontext localcontext = new basichttpcontext();  httppost httppost = new httppost("https://www.google.com/calendar/feeds/default/owncalendars/full");   list<namevaluepair> datatopost = new arraylist<namevaluepair>();   datatopost.add(new basicnamevaluepair("yourxml", myxml));   httppost.setentity(new urlencodedformentity(datatopost));   httpresponse response = httpclient.execute(httppost, localcontext);   } catch (exception e) {  e.printstacktrace();  } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -