{ "id": "92978", "key": "AC-3152", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-06-11T13:56:42.000+0000", "created": "2012-06-08T00:36:39.000+0000", "labels": [ "http", "httpclient", "mobilesdk", "put", "server" ], "versions": [], "issuelinks": [], "assignee": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:48:13.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "It seems that any form of response from a PUT request is being swallowed by the Titanium.Network.HTTPClient.\r\nI know that PUT requests shouldn't necessarily send a response, but I don't see the point in it being omitted. I have tried sending the response both directly, but also sending a Location header back to the HTTPClient after the PUT and dumping the response at the redirected location.\r\nThe onload callback of the request object has the responseText property missing in both cases:\r\n{code:javascript}\r\n{\"source\":{\"cache\":false},\"type\":\"load\"}\r\n{code}\r\n\r\nSteps to reproduce:\r\n- Write a serverside script that will accept a PUT request and send some kind of response (JSON in my case)\r\n- Send a request:\r\n{code:javascript}\r\nvar client = Ti.Network.createHTTPClient({\r\n onload: function(e)\r\n {\r\n Ti.API.info(e);\r\n },\r\n onerror: function(e)\r\n {\r\n Ti.API.error(e);\r\n }\r\n });\r\nclient.open('PUT', 'http://server/resource/location');\r\nclient.send('property=value');\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "HTTPClient swallows PUT response", "creator": { "name": "chris@chlab.ch", "key": "chris@chlab.ch", "displayName": "Christof Leuenberger", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "chris@chlab.ch", "key": "chris@chlab.ch", "displayName": "Christof Leuenberger", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 2.0.1.GA2 on Mac OS X. Server: PHP on Apache", "comment": { "comments": [ { "id": "197833", "author": { "name": "chris@chlab.ch", "key": "chris@chlab.ch", "displayName": "Christof Leuenberger", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm sorry, this seems to work. It looks like the problem was that my onload handler was being overridden by another request, in combination with the response object being logged without the responseText attribute (that might the bug?).\r\nPlease close.", "updateAuthor": { "name": "chris@chlab.ch", "key": "chris@chlab.ch", "displayName": "Christof Leuenberger", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-08T01:50:30.000+0000", "updated": "2012-06-10T23:28:40.000+0000" }, { "id": "197958", "author": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "body": "Out of interest, were you able to get any progress from the 'onsendstream' event and a PUT request/upload? \r\n\r\nI could not. ", "updateAuthor": { "name": "kosso", "key": "kosso", "displayName": "kosso", "active": true, "timeZone": "Europe/London" }, "created": "2012-06-10T07:21:27.000+0000", "updated": "2012-06-10T07:21:27.000+0000" }, { "id": "197966", "author": { "name": "chris@chlab.ch", "key": "chris@chlab.ch", "displayName": "Christof Leuenberger", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I just tried, and I get one callback from the onsendstream event, that logs the following:\r\n{code}\r\n{\"source\":{\"cache\":false},\"type\":\"sendstream\",\"progress\":1}\r\n{code}", "updateAuthor": { "name": "chris@chlab.ch", "key": "chris@chlab.ch", "displayName": "Christof Leuenberger", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-10T23:32:55.000+0000", "updated": "2012-06-10T23:33:10.000+0000" }, { "id": "198058", "author": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "marked it as invalid by the reporter thats why closing it ", "updateAuthor": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-11T13:56:42.000+0000", "updated": "2012-06-11T13:56:42.000+0000" }, { "id": "285992", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as per Christof's feedback.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-27T20:10:24.000+0000", "updated": "2013-12-27T20:10:24.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }