{ "id": "63950", "key": "TIMOB-3318", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-08T23:28:58.000+0000", "created": "2011-04-15T03:42:02.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "tbs-1.8.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-08T23:28:58.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

I have an issue using Titanium.Network.createHTTPClient with\nAndroid. Im trying to call an url http://www.motorsport-total.com/f1/live/htdocs/ticker.php\n. When i call this url a redirect should happen as you can see if\nyou use an usual web browser like firefox or chrome. It usually\nredirects to this url : \nhttp://www.motorsport-total.com/f1/live/htdocs/ticker.php?strecken_...

\n

Then i want to get those get parameters for using them in my app\nto get the latest race results. This works great with iOs but\ndoenst work with Android. It still keeps on http://www.motorsport-total.com/f1/live/htdocs/ticker.php

\n

Is there any way to get the redirect working or to get those get\nparameters? I really need that fast because the iOs Version is\nalready available in the iTunes Store and our client wants to go\nlive with the Android Version. And thats the last big issue i\nhave.

\n

This is the code:

\n
\nfunction get_last()\n{\n  var req = new r_ajax('http://www.motorsport-total.com/f1/live/htdocs/ticker.php', function(f)\n  {\n    Titanium.API.info('location of request = ' + f.location);\n    var query = f.location.replace('http://www.motorsport-total.com/f1/live/htdocs/ticker.php?', '');\n    var vars = query.split(\"&\");\n \n    for (var i = 0; i < vars.length; i++) \n    {\n      Titanium.API.error(vars[i]);\n      var pair = vars[i].split(\"=\");\n \n      if (pair[0] == 'strecken_id') \n      {\n        win.strecken_id = pair[1];\n      }\n \n      if (pair[0] == 'event_id') \n      {\n        win.event_id = pair[1];\n      }\n    }\n \n    Titanium.API.info('win.strecken_id = ' + win.strecken_id );\n    Titanium.API.info('win.event_id = ' + win.event_id);\n \n    xmlFile = 'http://www.motorsport-total.com/f1/live/xmlfeed/generic/S_ID_' + win.strecken_id + '_EV_ID_' + win.event_id + '.xml';\n    xmlNewsFile = 'http://www.motorsport-total.com/f1/live/xmlfeed/generic/S_ID_' + win.strecken_id + '_EV_ID_' + win.event_id + '_news.xml';\n    createTickerValues(\n    {\n      url: xmlFile\n    }, showLive, live_err);\n  }, function()\n  {\n    Titanium.API.error('Error at function get_last live.js = ' + e);\n  }, 'GET').send();\n}\n
\n
\nvar r_ajax =  function(url,on_ok, on_err, method, async) {\n    var async = !!async ? true : false;\n    var method = !!method ? method : 'POST';\n    var xhr = Titanium.Network.createHTTPClient();\n \n    xhr.onload = function()\n  {\n        on_ok(this);\n        xhr.abort();\n    };\n \n    xhr.onerror = function(e){\n        on_err(e);\n        xhr.abort();\n    };  \n \n \n    xhr.open(method,url,async);\n \n    return {\n        xhr:xhr,\n        send:function(data) {\n            xhr.send(data); \n        },\n        abort:function() { xhr.abort();}\n    };\n};\n
{html}", "attachment": [], "flagged": false, "summary": "No Redirect when using Titanium.Network.createHTTPClient", "creator": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130523", "author": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Problem

\n

Confirmed that above code works properly if not redirected and\nfails only on Android when redirect is required.

\n

Test

\n

Tested on TiDev 1.6 and 1.7 (03/10/11) emulator APIs 2.2.

\n

Failed test results:

\n

win.strecken_id = undefined
\nwin.event_id = undefined

\n

Ticket Reference

\n

HD Ticket Reference: http://developer.appcelerator.com/helpdesk/view/76362

{html}", "updateAuthor": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:42:03.000+0000", "updated": "2011-04-15T03:42:03.000+0000" }, { "id": "421576", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as there has been no input for the last 6 years. Any problems, please file a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-08T23:28:58.000+0000", "updated": "2017-06-08T23:28:58.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }