{ "id": "105045", "key": "TIMOB-13275", "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": [ { "id": "15397", "description": "2013 Soprint 07 API", "name": "2013 Sprint 07 API", "archived": true, "released": true, "releaseDate": "2013-04-08" }, { "id": "15105", "description": "2013 Sprint 07", "name": "2013 Sprint 07", "archived": true, "released": true, "releaseDate": "2013-04-08" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-03-29T21:07:59.000+0000", "created": "2012-11-15T15:47:11.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "HttpClient", "android", "ipass1", "sdk2.1.4", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:37:06.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": "When using the current SDK 2.1.4 the POST DATA is not sending on Android.\r\nA normal json format post is being send:\r\n\r\n{code}\r\n //THIS IS NOT RECEIVED ON THE SERVER (ONLY ANDROID) ---\r\n var orderOptions = {};\r\n orderOptions.username = 'USERNAME';\r\n orderOptions.password = 'PASSWORD';\r\n orderOptions.somevar = 'Some data';\r\n\r\n var client = Ti.Network.createHTTPClient({\r\n\t\tonload : function(e) {\r\n\t\t\t\r\n \t\t}\r\n\t\t\t\r\n },\r\n onerror : function(e) {\r\n \t\r\n \tif(errorCallback != null) {\r\n \t\t\terrorCallback(false);\r\n \t\t}\r\n\r\n },\r\n timeout : 5000\r\n\t});\r\n\t\r\n client.open(\"POST\", 'http://www.somedomain.com/afile.php');\r\n client.setRequestHeader('Content-Type', 'text/html; charset=utf-8;');\r\n client.send(orderOptions);\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: HTTPClient not sending POST vars", "creator": { "name": "patrickjongmans", "key": "patrickjongmans", "displayName": "Patrick Jongmans", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "patrickjongmans", "key": "patrickjongmans", "displayName": "Patrick Jongmans", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android 4.0\r\nAndroid 2.3.3\r\nSDK 2.1.4.GA\r\nSDK 3.0.2.GA\r\nSDK 3.1.0.v20130327130410", "comment": { "comments": [ { "id": "232559", "author": { "name": "bridgesense", "key": "bridgesense", "displayName": "Francis Meetze", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is this issue being escalated?\n\nReference: http://developer.appcelerator.com/question/146006/google-app-engine-seems-to-confuse-android-post-with-get-over-httpclient#answer-253222", "updateAuthor": { "name": "bridgesense", "key": "bridgesense", "displayName": "Francis Meetze", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-27T06:41:53.000+0000", "updated": "2012-12-27T06:41:53.000+0000" }, { "id": "244671", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tested this and confirming bug. (works as expected on android)\r\n\r\nh4. Code on my server:\r\n{code}\r\n\r\n\r\n{ username: \"\", password: \"\" }\r\n{code}\r\n\r\nh4. Titanium code:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'here'\r\n});\r\n\r\nwin.add(btn);\r\n\r\nwin.open();\r\n\r\nbtn.addEventListener('click', function(){\r\n\tvar xhr = Ti.Network.createHTTPClient();\r\n\txhr.onload = function() {\r\n\t\talert(this.responseText);\r\n\t}\r\n\txhr.onerror = function() {\r\n\t\talert(this.responseText);\r\n\t}\r\n\txhr.open('POST', 'http://pec1985.com/me/test.php');\r\n\r\n\txhr.setRequestHeader('Content-Type', 'text/html; charset=utf-8;');\r\n\t\r\n\txhr.send({\r\n\t\tusername: 'some_user_name',\r\n\t\tpassword: 'some_password'\r\n\t});\r\n});\r\n{code}\r\n\r\nh4. Expected response from server:\r\n{code}\r\n{ username: \"some_user_name\", password: \"some_password\" }\r\n{code}\r\n\r\nh4. Real response from server on Android\r\n{code}\r\n{ username: \"\", password: \"\" }\r\n{code}\r\n", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-29T17:04:17.000+0000", "updated": "2013-03-29T17:22:13.000+0000" }, { "id": "244682", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Same happens on 3.0.2.GA", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-29T17:58:52.000+0000", "updated": "2013-03-29T17:58:52.000+0000" }, { "id": "244713", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~penrique] Shouldn't the content type signify form encoded data (eg:application/x-www-form-urlencoded). Can you retry with the new content type.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-29T21:01:36.000+0000", "updated": "2013-03-29T21:01:36.000+0000" }, { "id": "244715", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving this as invalid since I suspect this is due to the wrong content type.\r\n\r\nIf it is not so, please reopen ticket.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-03-29T21:07:59.000+0000", "updated": "2013-03-29T21:07:59.000+0000" }, { "id": "248706", "author": { "name": "bridgesense", "key": "bridgesense", "displayName": "Francis Meetze", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It would be great if this was re-opened. There seems to be some intermittent issues with the POST method being confused with GET and that is why the POST parameters aren't being received properly.\r\n\r\nI am able to duplicate this with applications running with the latest Android ICS OS.\r\n\r\nSomething this simple:\r\nxhr.open('POST', 'http://www.some-web-site.com/mobileupdate/masterstack');\r\nxhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\r\nxhr.send();\r\n\r\nAlthough no data is being sent in this example, it should still be read as a POST. It is not:\r\n\r\n[22/Apr/2013:16:58:06 -0700] \"GET /mobileupdate/masterstack/ HTTP/1.1\" 200 146036 - - \"www.my_website.com\" ms=58 cpu_ms=21 cpm_usd=0.016321 app_engine_release=1.7.7 \r\n\r\nHowever, the POST works fine on devices running Gingerbread. See reference: http://developer.appcelerator.com/question/146006/google-app-engine-seems-to-confuse-android-post-with-get-over-httpclient\r\n\r\nTitanium 3.1; SDK 3.0.2.GA", "updateAuthor": { "name": "bridgesense", "key": "bridgesense", "displayName": "Francis Meetze", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-23T00:02:39.000+0000", "updated": "2013-04-23T00:02:39.000+0000" }, { "id": "416046", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~jquick] Could you see if the POST is working as expected for you.\r\n", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T20:35:27.000+0000", "updated": "2017-03-28T20:35:27.000+0000" }, { "id": "439953", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid. If incorrect, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:37:06.000+0000", "updated": "2018-08-06T17:37:06.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }