Titanium Community Questions & Answer Archive

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

httpClient issues on Android

I'm trying to send data to a webpage. The code works great on the iPhone but does nothing on Android. I don't get an error, the code is executed but it just doesn't get sent. Any ideas?

        var trans = Titanium.Network.createHTTPClient();

        trans.onerror = function(e)
        {
            Ti.API.info('TRANS ERRROR - ' + e.error);
        }

        //first send Team data
        trans.open('GET', encodeURI('http://runningescapes.com/relaytracker/syncTeam.aspx?TeamName='+Race.TeamName + '&TeamId=' + Race.Van +'&TeamKey='+Race.TeamKey+'&StartTime='+Race.startTime +'&RaceName='+Race.RaceName));
        trans.send();
— asked October 10th 2010 by Judy Adabie
  • android
  • get
  • httpclient
0 Comments

1 Answer

  • Accepted Answer

    Try this:

    var trans = Titanium.Network.createHTTPClient();
    trans.onerror = function(e)
    {
    Ti.API.info('TRANS ERRROR - ' + e.error);
    }
    
    //first send Team data
    trans.open('GET', 'http://runningescapes.com/relaytracker/syncTeam.aspx?TeamName='+encodeURI(Race.TeamName) + '&TeamId=' + encodeURI(Race.Van) +'&TeamKey='+encodeURI(Race.TeamKey)+'&StartTime='+encodeURI(Race.startTime) +'&RaceName='+encodeURI(Race.RaceName));
    trans.send();
    
    — answered October 11th 2010 by Peter Griffin
    permalink
    0 Comments
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.