How to POST xml file using http request in Android?
-
I'm trying to POST the following xml to a server url, but i don't know how to go about it. GET requests are easy enough, but I'm having a problem with POST requests. <? xml version=1.0> <Request> <Elemtnt> <data id="1">E1203</data> <data id="2">E1204</data> </Element> </Request>
-
Answer:
reate a string like this: String myXML = "<? xml version=1.0> <Request> <Elemtnt> <data id=\"1\">E1203</data> <data id=\"2\">E1204</data> </Element> </Request>"; and use the same string in my previous answer: http://stackoverflow.com/questions/7737610/how-to-attach-xml-file-in-message-body-of-http-post-request/7738506#7738506
Gensheriff at Stack Overflow Visit the source
Other answers
This question has been answered many times on Stackoverflow. Here: http://stackoverflow.com/questions/2559948/android-sending-xml-via-http-post-soap and here: http://stackoverflow.com/questions/5013373/android-send-and-receive-xml-via-http-post-method and here: http://stackoverflow.com/questions/5582830/send-xml-files-in-android-with-http-post If you already do it this way, then post some of your code.
Franziskus Karsunke
Related Q & A:
- how delete node in xml file using php?Best solution by Stack Overflow
- How to read csv file using php?Best solution by Stack Overflow
- How to Read xml file in java?Best solution by Stack Overflow
- how to parse a xml file using jquery and phonegap?Best solution by Stack Overflow
- How to write XML file with Java and read it?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.