{ "id": "130804", "key": "TIMOB-17145", "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": [ { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-05-15T02:30:00.000+0000", "created": "2014-05-22T22:24:28.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "HttpClient" ], "versions": [ { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" } ], "issuelinks": [ { "id": "51174", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "151275", "key": "TIMOB-19564", "fields": { "summary": "Android: HttpClient patch method doesn't work from 5.0.0", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2018-08-06T17:49:19.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": "It would be great if the HTTPClient supported PATCH requests. We use ASP Web Api 2 and the convention is to use a PATCH request for a partial update. ", "attachment": [], "flagged": false, "summary": "Android: Add support to HTTPClient for PATCH requests", "creator": { "name": "nick@bill4time.com", "key": "nick@bill4time.com", "displayName": "NIck", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nick@bill4time.com", "key": "nick@bill4time.com", "displayName": "NIck", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Any", "closedSprints": [ { "id": 404, "state": "closed", "name": "2015 Sprint 10 SDK", "startDate": "2015-05-09T00:00:53.391Z", "endDate": "2015-05-23T00:00:00.000Z", "completeDate": "2015-05-25T14:55:16.386Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "308597", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this feature request to engineering for further evaluation and prioritization. Here is an informative link:\r\n\r\nhttps://www.mnot.net/blog/2012/09/05/patch", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-12T04:48:47.000+0000", "updated": "2014-06-12T04:48:47.000+0000" }, { "id": "338229", "author": { "name": "atticoos", "key": "atticoos", "displayName": "Atticus White", "active": true, "timeZone": "America/Los_Angeles" }, "body": "What's the roadmap looking like for introducing more request methods? It's impossible right now to integrate with any RESTful resources that requires PATCH with the current HTTP proxy utilizing apache's http client. And lookiing through the docs, it's apparent that the capability exists, the current approach just uses unsupporting factories. http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/methods/HttpPatch.html", "updateAuthor": { "name": "atticoos", "key": "atticoos", "displayName": "Atticus White", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-07T20:18:18.000+0000", "updated": "2015-01-07T22:11:44.000+0000" }, { "id": "339131", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~atticoos] We don't have a direct ETA at the moment, but we are happy to review a PR if you are able to contribute one.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-01-14T23:13:57.000+0000", "updated": "2015-01-14T23:13:57.000+0000" }, { "id": "349247", "author": { "name": "kabomi", "key": "kabomi", "displayName": "Imobach Martín", "active": true, "timeZone": "Europe/Berlin" }, "body": "The problem seems to affect Android platform only.\r\nI tried to reproduce the problem in iOS with MobileSDK 3.5.0.GA, but it’s working as expected.\r\n\r\n[https://github.com/appcelerator/titanium_mobile/pull/6777]\r\nThis PR’s been tested in Android with MobileSDK 4.1.0 (latest). But it should work for older SDKs.\r\nAttached to PR is an Alloy app index.js, a screenshot showing the problem and other screenshot with the expected outcome.\r\n\r\nChanges to http://docs.appcelerator.com/titanium/3.0/#!/guide/HTTPClient_and_the_Request_Lifecycle\r\nwould also be needed.", "updateAuthor": { "name": "kabomi", "key": "kabomi", "displayName": "Imobach Martín", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-04-12T16:49:15.000+0000", "updated": "2015-04-12T16:49:15.000+0000" }, { "id": "350207", "author": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "body": "@ingo, is there any update on this? I just hit this issue and it is a blocking bug, seeing as the API that I am using requires PATCH for an update to specific data", "updateAuthor": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-04-21T04:36:13.000+0000", "updated": "2015-04-21T04:36:13.000+0000" }, { "id": "350237", "author": { "name": "atticoos", "key": "atticoos", "displayName": "Atticus White", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm still waiting on a solution as well @Yrkh8trnoy. https://github.com/appcelerator/titanium_mobile/pull/6777 seems to be a first step towards integrating the support for PATCH, but lacks support for the rest of the unsupported areas of the HTTP spec.\r\n\r\nIn the meantime, if you have an immediate need, I've created an OkHttp client for Android https://github.com/ajwhite/titanium-okhttp. It can be installed with gittio nice and easily. Built with complete backward compatible integration with your existing http client, you basically just need to call a different factory method.", "updateAuthor": { "name": "atticoos", "key": "atticoos", "displayName": "Atticus White", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-21T12:56:25.000+0000", "updated": "2015-04-21T12:56:56.000+0000" }, { "id": "352606", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR accepted.\r\n\r\nDocument PR update: https://github.com/appcelerator/titanium_mobile/pull/6851", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-05-15T02:30:36.000+0000", "updated": "2015-05-15T02:48:08.000+0000" }, { "id": "352613", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Document PR merged.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-05-15T04:24:08.000+0000", "updated": "2015-05-15T04:24:08.000+0000" }, { "id": "380868", "author": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "body": "Looks like this popped back up for me folks:\r\n\r\n03-28 17:04:22.477: E/TiHTTPClient(2944): (TiHttpClient-23) [32887,66809] HTTP Error (java.net.ProtocolException): Unknown method 'PATCH'; must be one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE]\r\n03-28 17:04:22.477: E/TiHTTPClient(2944): java.net.ProtocolException: Unknown method 'PATCH'; must be one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE]\r\n03-28 17:04:22.477: E/TiHTTPClient(2944): \tat java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:685)\r\n03-28 17:04:22.477: E/TiHTTPClient(2944): \tat ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1137)\r\n03-28 17:04:22.477: E/TiHTTPClient(2944): \tat java.lang.Thread.run(Thread.java:841)\r\n\r\nAny idea why it would resurface?", "updateAuthor": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-03-29T00:59:19.000+0000", "updated": "2016-03-29T00:59:19.000+0000" }, { "id": "380870", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~Yrkh8trnoy] PATCH is not supported. We have now moved to using HTTPUrlConnection which Android does not have PATCH available for now. They have mentioned it will be available in the future. This is due to the move away from APACHE HttpClient due to Android removing support for this.\r\n\r\nIf you need PATCH, you could use the libraries/modules that will support PATCH.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-29T02:08:53.000+0000", "updated": "2016-03-29T02:08:53.000+0000" }, { "id": "380885", "author": { "name": "atticoos", "key": "atticoos", "displayName": "Atticus White", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Kiley, I ran into the same problem last year. I built a networking module that uses the OkHttp networking library, which supports `PATCH`. Perhaps this can help you out https://github.com/ajwhite/titanium-okhttp\r\n", "updateAuthor": { "name": "atticoos", "key": "atticoos", "displayName": "Atticus White", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-29T05:07:05.000+0000", "updated": "2016-03-29T05:07:05.000+0000" }, { "id": "380894", "author": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "body": "Atticus, yes sir, I remember and I saw and tried to revert back to using that a couple of hours ago. It looks like it's a bit outdated in terms of certain methods missing from the base HTTPClient you were extending. Any chance you can update that? I left you a message on GitHub. If so, it'd be a PERFECT fix right now. I'll try to locate you offline/PM.\r\n\r\n@Ashraf, thanks. Do you have any suggestions? (Besides Atticus' of course, which looks great if updated ;-))", "updateAuthor": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-03-29T07:45:59.000+0000", "updated": "2016-03-29T07:45:59.000+0000" }, { "id": "380896", "author": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "body": "@Ashraf, also, do you have any links to where they mention future support?", "updateAuthor": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-03-29T07:55:32.000+0000", "updated": "2016-03-29T07:55:32.000+0000" }, { "id": "380897", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Here's the Issue Tracker for Android: https://code.google.com/p/android/issues/detail?id=76611", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-29T08:11:21.000+0000", "updated": "2016-03-29T08:11:21.000+0000" }, { "id": "391096", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "So the issue was introduced upstream in Android itself. Basically they moved from using Apache HTTPClient to wanting developers to use URLConnection. So we did. But Java/Android doesn't support PATCH on HttpURLConnection. So to truly support it we'd need to re-introduce the dependency back on Apache's HTTPClient in Titanium, and then only use that client if the request is a PATCH. That seems like a bit of overkill for this case, and would inflate app sizes.\r\n\r\nOne possible workaround: Some servers have hacks in to workaround this deficiency in Java/Android of not having PATCH builtin\r\nYou can try using a POST and setting a special header to see if the server will treat it as a PATCH: httpost.setHeader(\"X-HTTP-Method-Override\", \"PATCH\");\r\nBasically mimic this: http://stackoverflow.com/questions/25163131/httpurlconnection-invalid-http-method-patch\r\n\r\n{code:javascript}\r\nvar client = Ti.Network.createHTTPClient();\r\n// ... do whatever you typically do here.\r\n// Set the special header to have some servers treat this as PATCH\r\nclient.setRequestHeader('X-HTTP-Method-Override', 'PATCH');\r\n// Prepare the connection. Note we actually do a POST\r\nclient.open('POST', url);\r\n// Send the request.\r\nclient.send(data);\r\n{code}", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-07-20T16:58:13.000+0000", "updated": "2016-07-20T19:37:26.000+0000" }, { "id": "391100", "author": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "body": "Thanks @cwilliams", "updateAuthor": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-07-20T17:14:13.000+0000", "updated": "2016-07-20T17:14:13.000+0000" }, { "id": "440116", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:19.000+0000", "updated": "2018-08-06T17:49:19.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }