Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.


— asked April 18th 2010 by Shaun Ellithorpe

2 Answers

  • Accepted Answer

    Format the data as you wish and do

    // Create the AJAX connection
        var xhr = Titanium.Network.createHTTPClient();
        // set the URL
        var data = {}; // your data formatted however you want it
        // trigger the HTTP call

    Where "data" is your data object (can be named whatever you want)

    — answered April 18th 2010 by Raul Riera
  • good info raul!

    — answered April 18th 2010 by danno watts
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.