{ "id": "121339", "key": "TIMOB-15514", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-06-26T22:13:12.000+0000", "created": "2013-10-17T20:15:03.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "33973", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "120724", "key": "AC-2115", "fields": { "summary": "Android: HttpClient file uploads result in different MIME encoding than iOS", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "32587", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "121296", "key": "TIMOB-15510", "fields": { "summary": "Android: HTTPClient missing boundary when Content-Type is set", "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 } } } }, { "id": "32586", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "121295", "key": "TIMOB-15509", "fields": { "summary": "Android: HTTPClient cannot send POST data as Ti.Filesystem.File", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "32585", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "121326", "key": "TIMOB-15512", "fields": { "summary": "MobileWeb: HTTPClient - GUID is not being sent in X-Titanium-Id header", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-24T20:54: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" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" }, { "id": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "ENVIRONMENT:\r\nMac OS X 10.8.4\r\nAppcelerator Studio, build: 3.2.0.201310141852 (all platforms except MW)\r\nTitanium Studio, build: 3.1.3.GA (for MW only)\r\nTiSDK 3.2.0.v20131015134843\r\nAndroid 4.2.2 / API Level 17\r\niOS 7.0 / Xcode 5\r\nGoogle Chrome Version 30.0.1599.101\r\nBlackBerry SDK 10.2.0.15\r\n\r\nREPRODUCTION:\r\n1. Add/run the server code on your machine with Apache and PHP enabled. I placed mine in my ~/Sites/ directory.\r\n2. Replace with your local IP (and \"/~username\" if needed).\r\n3. Launch the client code below on the different emulator/simulators/browser and press the Submit button. See the console log output.\r\n\r\nRESULTS:\r\nContent-Type header varies based on the platform and data type sent.\r\n\r\nOn the Android and iOS platforms:\r\n\r\n * If you are sending a JavaScript object, the content type is set to `multipart/form-data`.\r\n * For all other data types on Android, the content type is set to `application/x-www-form-urlencoded`.\r\n * For all other data types on iOS, the content type is **NOT** set.\r\n\r\nOn the BlackBerry, Mobile Web and Tizen platforms, the content type is always set to `application/x-www-form-urlencoded` as the default.\r\n\r\nEXPECTED RESULTS:\r\nPlatforms should be somewhat more cohesive.\r\n\r\n\r\nSERVER CODE (server.php):\r\n{code}\r\n apache_request_headers()));\r\n}\r\n?>\r\n\r\n\r\n{code}\r\n\r\nCLIENT CODE (app.js):\r\n\r\n{code}\r\n\r\n var form_url = 'http:///server.php';\r\n \r\n var win = Ti.UI.createWindow({\r\n layout : 'vertical',\r\n backgroundColor : '#fff'\r\n });\r\n var txtTitle = Ti.UI.createTextField({\r\n top : '80dp',\r\n value : 'My Photo Title'\r\n });\r\n win.add(txtTitle);\r\n \r\n var anImageView = Ti.UI.createImageView({\r\n image : 'images/flower.jpg',\r\n width : 50,\r\n height : 50,\r\n \r\n });\r\n anImageView.addEventListener('load', function() {\r\n Ti.API.info('Image loaded!');\r\n });\r\n \r\n win.add(anImageView);\r\n \r\n var btnSubmit = Ti.UI.createButton({\r\n title : 'Submit'\r\n });\r\n btnSubmit.addEventListener('click', function(e) {\r\n // Send with HTTPClient\r\n \r\n var c = Ti.Network.createHTTPClient({\r\n onload : function() {\r\n Ti.API.info(this.responseText);\r\n Ti.API.info(\"TEXT: \" + this.responseText);\r\n json = JSON.parse(this.responseText);\r\n Ti.API.info('json' + json);\r\n },\r\n onerror : function(e) {\r\n Ti.API.info(\"STATUS: \" + this.status);\r\n Ti.API.info(\"TEXT: \" + this.responseText);\r\n Ti.API.info(\"ERROR: \" + e.error);\r\n },\r\n timeout : 50000\r\n });\r\n c.enableKeepAlive = false;\r\n c.open('POST', form_url); \r\n\r\n //c.setRequestHeader('Content-Type', 'multipart/form-data');\r\n //c.send(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, \"/images/flower.jpg\"));\r\n //c.send('String!');\r\n //c.send(anImageView.toBlob());\r\n \r\n c.send({\r\n title : txtTitle.value,\r\n image : Ti.Utils.base64encode(anImageView.image)\r\n });\r\n \r\n \r\n });\r\n win.add(btnSubmit);\r\n \r\n win.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "HTTPClient: Disparity between All Platforms for Handling Content-Type Header", "creator": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "427212", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Mobile Web has been deprecated and will be removed in fixVersion 7.0.0.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-24T20:54:39.000+0000", "updated": "2017-08-24T20:54:39.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }