{ "id": "117437", "key": "TIMOB-14613", "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": "15646", "description": "2013 Sprint 18", "name": "2013 Sprint 18", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15690", "description": "2013 Sprint 18 API", "name": "2013 Sprint 18 API", "archived": true, "released": true, "releaseDate": "2013-09-06" } ], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-08-26T22:34:36.000+0000", "created": "2013-07-22T08:54:14.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T22:29:18.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": "h1. Problem description\r\nWhen sending a POST request, under some circumstances the event 'onsendstream' does not fire properly.\r\n\r\nh1. Test code\r\nThe following code is working fine for me, but fails for the customer - using different servers. It might be related to the information sent from the different servers; when the code fails, the event is only fired once with a negative progress value.\r\n\r\n{code}\r\nvar request = Ti.Network.createHTTPClient({\r\n onload: function() {\r\n Ti.API.info(this.responseText);\r\n },\r\n\r\n onerror: function(e) { \r\n Ti.API.info(JSON.stringify(e));\r\n },\r\n\r\n onsendstream: function(e) {\r\n Ti.API.info('progress_onsendstream: ' + e.progress)\r\n },\r\n\r\n ondatastream: function(e) {\r\n Ti.API.info('progress_ondatastream: ' + e.progress)\r\n },\r\n\r\n timeout: 60000\r\n});\r\n\r\nvar f = Ti.Filesystem.getFile(\"somefile\");\r\nvar cnt = f.read();\r\n\r\nrequest.open(\"POST\", serverurl);\r\nrequest.setRequestHeader(\"Content-type\", \"application/json\");\r\nrequest.send({\r\n \"name\": f.name,\r\n \"data\": cnt,\r\n});\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: HTTP Client onsendstream does not fire when sending a POST request", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "415130", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to the information that was requested was not provided.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:29:18.000+0000", "updated": "2017-03-22T22:29:18.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }