How to Post an XML in HTTP?

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

Was this solution helpful to you?

Other answers

Franziskus Karsunke

Related Q & A:

Just Added Q & A:

Find solution

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.