{ "id": "119583", "key": "TIMOB-15065", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-02-05T23:02:03.000+0000", "created": "2013-09-06T12:50:22.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [ { "id": "33104", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "118959", "key": "TIMOB-14954", "fields": { "summary": "iOS: ASI HTTP Library converts DELETE requests to POST requests", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-11-21T07:55:39.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": "h2. Problem description\r\nWhen using the HTTP verb 'DELETE', the body does not seem to be sent out, when passing it to the send() method.\r\n\r\nh2. Steps to reproduce\r\n{code}\r\nvar payload = {\r\n\t\"first\": {\r\n\t\t\"id\" : \"11\"\r\n\t},\r\n\t\"second\" : \"TEST\"\r\n};\r\n\r\nvar xhr = Titanium.Network.createHTTPClient({\r\n\tonload: function (e) {\r\n\t\talert(this.responseText);\r\n\t}\r\n});\r\nxhr.open('DELETE', 'SOMESERVER');\r\nxhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\nxhr.send(JSON.stringify(payload));\r\n{code}\r\n\r\nRunning the code, on the server side there is no data received; using PHP, I both verified $_POST and json_decode(file_get_contents('php://input')) and they are empty.\r\n\r\nChanging the method to POST or PUT will show the data on the server.\r\n", "attachment": [], "flagged": false, "summary": "Android: HTTPClient does not send body for DELETE requests", "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": "SDK 3.1.2\r\nSDK 3.2.0\r\nAndroid 4.3", "comment": { "comments": [ { "id": "278424", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2013-11-06T15:37:48.000+0000", "updated": "2013-11-06T15:37:48.000+0000" }, { "id": "289099", "author": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm curious if there's an update for this issue? It's a tiny change to the code. It's easy to make the change in the code for iOS and re-build but the Android source code is not exposed so we are a bit stuck here.", "updateAuthor": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-21T19:58:51.000+0000", "updated": "2014-01-21T19:58:51.000+0000" }, { "id": "291535", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This apparently is not native behavior on Android, and is generally not supported by other platforms (iOS appears to be an exception). As iOS is the outlier, we won't/can't bring all the platforms into line. I would suggest passing needed data along the URL.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:02:03.000+0000", "updated": "2014-02-05T23:02:03.000+0000" }, { "id": "291558", "author": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ingo, there is code in both the Android and iOS Titanium SDKs to explicitly change DELETE requests to POST requests if you try to pass a request body with a DELETE. Titanium should not be making this decision, it should be left up to the user whether they want to make a DELETE request with a body. It doesn't seem like it relates to what the native behavior is, since Titanium is getting involved before it ever reaches the OS.", "updateAuthor": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:48:06.000+0000", "updated": "2014-02-05T23:48:06.000+0000" }, { "id": "291559", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We are addressing the iOS issue. Do you have a link for the Android location you are referencing?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:51:35.000+0000", "updated": "2014-02-05T23:51:35.000+0000" }, { "id": "291560", "author": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Line 1107 of the HTTPClient implementation. A variable is set called isPostOrPut and later on line 1130 it will only send a request body if the method is a POST or PUT request. DELETE requests fall through.\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java", "updateAuthor": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:58:32.000+0000", "updated": "2014-02-05T23:58:32.000+0000" }, { "id": "291660", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As noted, it appears that it would be relatively trivial to change the logic around:\n\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L1130\n\nHowever, if we did so, would it work?\n\nhttp://stackoverflow.com/questions/10338615/sending-http-delete-request-in-android\n\nSuggests that it might not even send the data.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-06T17:40:49.000+0000", "updated": "2014-02-06T17:40:49.000+0000" }, { "id": "291666", "author": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yeah, digging further in there seems to be some debate as to whether DELETEs should be able to have a body, even though the RFC seems to indicate they can. I guess it would need to be tested. I know that when I made the modification to the iOS code, it started sending the request body without issue. I have not tested with Android as I'm not as familiar with recompiling the SDK.", "updateAuthor": { "name": "arskinner", "key": "arskinner", "displayName": "Andrew Skinner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-06T17:45:25.000+0000", "updated": "2014-02-06T17:45:25.000+0000" }, { "id": "416373", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as \"Won't Fix\". There has been no update for a while. If there is any problem, please open a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-30T20:50:04.000+0000", "updated": "2017-03-30T20:50:04.000+0000" }, { "id": "431087", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi guys, this is not fixed in 6.3.0, http request doesn't send body for DELETE type.\r\nCan you please make it work as iOS does(iOS doesn't have a problem). \r\nThanks", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2017-11-21T07:55:39.000+0000", "updated": "2017-11-21T07:55:39.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }