2

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>
2
  • For one, your XML is broken. <Elemtnt> and </Request. Commented Oct 12, 2011 at 11:42
  • Now read my question It is edited.. Commented Oct 12, 2011 at 11:47

2 Answers 2

3

This question has been answered many times on Stackoverflow.

Here: Android, sending XML via HTTP POST (SOAP)

and here: Android, send and receive XML via HTTP POST method

and here: Send xml files in android with http post

If you already do it this way, then post some of your code.

Sign up to request clarification or add additional context in comments.

Comments

2

Recreate 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: How to attach XML file in message body of HTTP post request?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.