Sending XML to a server and getting a response
I'm needing to send a piece of XML to my server, the server sends a response and then my mobile app interprets the XML the server send back to me.
I was looking in the xhr_xml.js in the kitchen sink files and get how to handle the data once I get it back, but I can't find and documentation or questions regarding sending the XML.
Formatting it as a it like a URL eg (http//www.example.com?data=1&moredata=2) is not an option unfortunately.
Any help or pointing me in the right direction would be great.
Thanks
2 Answers
-
Accepted Answer
Format the data as you wish and do
// Create the AJAX connection var xhr = Titanium.Network.createHTTPClient(); // set the URL xhr.open('POST','yourSiteAPI'); var data = {}; // your data formatted however you want it // trigger the HTTP call xhr.send(data);
Where "data" is your data object (can be named whatever you want)
-
good info raul!