{ "id": "127207", "key": "TIMOB-16557", "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": "15931", "description": "2014 Sprint 05", "name": "2014 Sprint 05", "archived": true, "released": true, "releaseDate": "2014-03-14" }, { "id": "15932", "description": "2014 Sprint 05 API", "name": "2014 Sprint 05 API", "archived": true, "released": true, "releaseDate": "2014-03-14" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-05-13T16:44:26.000+0000", "created": "2014-03-05T21:49:48.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_network", "qe-testadded" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [ { "id": "35586", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "inwardIssue": { "id": "123687", "key": "TIMOB-15980", "fields": { "summary": "iOS: Replace ASIHttp with NSURLConnection", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:28.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3.\r\nDescription: New HTTP Client cannot send numbers in post form\r\n\r\nServer Code: Just returning post data and header info\r\nPlace in ~/Sites folder, named 'server.php'\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n{code}\r\n apache_request_headers()));\r\n\r\n?>\r\n{code}\r\n\r\nClient Code: update the URLs with your own username\r\n{code}\r\nvar xhr = Ti.Network.createNewHTTPClient({\r\n\tonload: function(e) {\r\n\t\t//alert(this.responseData);\t\r\n\t\tTi.API.info('New HTTP Client');\r\n\t\tTi.API.info(JSON.stringify(this.responseData));\t\t\r\n\t\tTi.API.info(JSON.stringify(this.responseText));\t\t\r\n\t},\r\n\tonerror: function(e) {\r\n\t\tTi.API.error(e.error);\r\n\t}\r\n});\r\n//xhr.setRequestHeader('Content-Type', 'multipart/form-data'); \r\nxhr.open('POST', 'http://localhost/~your_name/server.php');\r\nxhr.send({\r\n\t\"test[0]\":1,\r\n\t\"test[1]\":2,\r\n\tfoo: 'foobar',\r\n\tarray: [1,2,3]\r\n});\r\n\r\nvar xhr = Ti.Network.createHTTPClient({\r\n\tonload: function(e) {\r\n\t\tTi.API.info('Old HTTP Client');\r\n\t\tTi.API.info(JSON.stringify(this.responseData));\t\t\r\n\t\tTi.API.info(JSON.stringify(this.responseText));\t\t\r\n\t},\r\n\tonerror: function(e) {\r\n\t\tTi.API.error(e.error);\r\n\t}\r\n});\r\nxhr.open('POST', 'http://localhost/~your_name/server.php');\r\nxhr.send({\r\n\t\"test[0]\":1,\r\n\t\"test[1]\":2,\r\n\tfoo: 'foobar',\r\n\tarray: [1,2,3]\r\n});\r\n{code}\r\nSample Log Output:\r\n\r\n{code}\r\n[INFO] : New HTTP Client\r\n[INFO] : {}\r\n[INFO] : \"{\\\"foo\\\":\\\"foobar\\\",\\\"array\\\":\\\"[1,2,3]\\\"}\r\n{\\\"header\\\":{\\\"Host\\\":\\\"localhost\\\",\\\"X-Titanium-Id\\\":\\\"7f8e8b5a-d939-4fff-8671-c656f18605e5\\\",\\\"X-Requested-With\\\":\\\"XMLHttpRequest\\\",\\\"Content-Type\\\":\\\"application\\\\/x-www-form-urlencoded; charset=utf-8\\\",\\\"Accept\\\":\\\"*\\\\/*\\\",\\\"Content-Length\\\":\\\"32\\\",\\\"Connection\\\":\\\"keep-alive\\\",\\\"Accept-Language\\\":\\\"en-us\\\",\\\"Accept-Encoding\\\":\\\"gzip, deflate\\\",\\\"User-Agent\\\":\\\"Appcelerator Titanium\\\\/3.3.0.v20140304134105 (iPhone Simulator\\\\/7.0.3; iPhone OS; en_US;)\\\"}}\"\r\n[INFO] : Old HTTP Client\r\n[INFO] : {}\r\n[INFO] : \"{\\\"foo\\\":\\\"foobar\\\",\\\"test\\\":[\\\"1\\\",\\\"2\\\"],\\\"array\\\":\\\"(\\\\n 1,\\\\n 2,\\\\n 3\\\\n)\\\"}\r\n{\\\"header\\\":{\\\"Host\\\":\\\"localhost\\\",\\\"X-Titanium-Id\\\":\\\"7f8e8b5a-d939-4fff-8671-c656f18605e5\\\",\\\"X-Requested-With\\\":\\\"XMLHttpRequest\\\",\\\"Accept-Encoding\\\":\\\"gzip\\\",\\\"Content-Type\\\":\\\"application\\\\/x-www-form-urlencoded; charset=utf-8\\\",\\\"Content-Length\\\":\\\"108\\\",\\\"Connection\\\":\\\"close\\\",\\\"User-Agent\\\":\\\"Appcelerator Titanium\\\\/3.3.0.v20140304134105 (iPhone Simulator\\\\/7.0.3; iPhone OS; en_US;)\\\"}}\"\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: NewHTTPClient not able to send numbers as post data", "creator": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 104, "state": "closed", "name": "2014 Sprint 10 SDK", "startDate": "2014-05-12T16:00:00.000Z", "endDate": "2014-05-24T00:00:00.000Z", "completeDate": "2014-05-27T18:11:47.424Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "295819", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/5433", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-05T22:22:19.000+0000", "updated": "2014-03-05T22:22:19.000+0000" }, { "id": "303800", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the issue with:\r\nAppc-Studio:3.3.0.201405011408\r\nsdk:3.3.0.v20140506145022\r\nacs:1.0.14\r\nalloy:1.4.0-dev\r\nnpm:1.3.2\r\ntitanium:3.3.0-dev\r\ntitanium-code-processor:1.1.1\r\nxcode:5.1.1\r\n\r\nGetting below mentioned error:\r\n{code}\r\n[WARN] : Attempted to load TiNetworkNewHTTPClientProxy: Could not find class definition.\r\n[ERROR] : Script Error {\r\n backtrace = \"#0 () at :0\";\r\n[ERROR] : line = 10;\r\n[ERROR] : message = \"invalid method (createNewHTTPClient) passed to NetworkModule\";\r\n[ERROR] : sourceId = 299248096;\r\n[ERROR] : sourceURL = \"file:///Users/p.agarwal/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/1738C242-6A30-44F0-A4D1-20165EF81961/hello.app/app.js\";\r\n[ERROR] : }\r\n{code}\r\n\r\nHence Reopening the issue.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-07T09:33:31.000+0000", "updated": "2014-05-07T09:55:12.000+0000" }, { "id": "304451", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The test case has changed. Ti.Network.createNewHTTPClient was a temporary testing object. Use Ti.Netowrk.createHTTPClient instead.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-12T20:54:01.000+0000", "updated": "2014-05-12T20:54:01.000+0000" }, { "id": "304547", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening the issue as not getting the expected output:\r\n\r\nAppc-Studio:3.3.0.201405121247\r\nsdk:3.3.0.v20140512162513\r\nacs:1.0.14\r\nalloy:1.4.0-dev\r\nnpm:1.3.2\r\ntitanium:3.3.0-dev\r\ntitanium-code-processor:1.1.1\r\nxcode:5.1.1\r\nDevice:IphoneSimulator(v7.1)\r\n\r\n\r\nUsed the below code:\r\n{code}\r\nvar xhr = Ti.Network.createHTTPClient({\r\n onload: function(e) {\r\n //alert(this.responseData); \r\n Ti.API.info('New HTTP Client');\r\n Ti.API.info(JSON.stringify(this.responseData)); \r\n Ti.API.info(JSON.stringify(this.responseText)); \r\n },\r\n onerror: function(e) {\r\n Ti.API.error(e.error);\r\n }\r\n});\r\n//xhr.setRequestHeader('Content-Type', 'multipart/form-data'); \r\nxhr.open('POST', 'http://localhost/~your_name/server.php');\r\nxhr.send({\r\n \"test[0]\":1,\r\n \"test[1]\":2,\r\n foo: 'foobar',\r\n array: [1,2,3]\r\n});\r\n \r\n\r\n{code}\r\n\r\nActual Result:\r\n{code}\r\nNew HTTP Client\r\n[INFO] : {}\r\n[INFO] : \"{\\\"foo\\\":\\\"foobar\\\",\\\"test\\\":[\\\"1\\\",\\\"2\\\"],\\\"array\\\":\\\"(\\\\n 1,\\\\n 2,\\\\n 3\\\\n)\\\"}{\\\"header\\\":{\\\"Host\\\":\\\"localhost\\\",\\\"X-Titanium-Id\\\":\\\"6a991287-98f3-4679-9faa-ab7c65199abd\\\",\\\"X-Requested-With\\\":\\\"XMLHttpRequest\\\",\\\"Accept\\\":\\\"*\\\\/*\\\",\\\"Content-Type\\\":\\\"application\\\\/x-www-form-urlencoded; charset=utf-8\\\",\\\"Content-Length\\\":\\\"84\\\",\\\"Accept-Language\\\":\\\"en-us\\\",\\\"Accept-Encoding\\\":\\\"gzip, deflate\\\",\\\"Connection\\\":\\\"keep-alive\\\",\\\"User-Agent\\\":\\\"Appcelerator Titanium\\\\/3.3.0 (iPhone Simulator\\\\/7.1; iPhone OS; en_US;)\\\"}}\"\r\n{code}\r\n\r\nExpected Result:\r\n{code}\r\n[INFO] : New HTTP Client\r\n[INFO] : {}\r\n[INFO] : \"{\\\"foo\\\":\\\"foobar\\\",\\\"array\\\":\\\"[1,2,3]\\\"}\r\n{\\\"header\\\":{\\\"Host\\\":\\\"localhost\\\",\\\"X-Titanium-Id\\\":\\\"7f8e8b5a-d939-4fff-8671-c656f18605e5\\\",\\\"X-Requested-With\\\":\\\"XMLHttpRequest\\\",\\\"Content-Type\\\":\\\"application\\\\/x-www-form-urlencoded; charset=utf-8\\\",\\\"Accept\\\":\\\"*\\\\/*\\\",\\\"Content-Length\\\":\\\"32\\\",\\\"Connection\\\":\\\"keep-alive\\\",\\\"Accept-Language\\\":\\\"en-us\\\",\\\"Accept-Encoding\\\":\\\"gzip, deflate\\\",\\\"User-Agent\\\":\\\"Appcelerator Titanium\\\\/3.3.0.v20140304134105 (iPhone Simulator\\\\/7.0.3; iPhone OS; en_US;)\\\"}}\"\r\n{code}\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-13T09:40:51.000+0000", "updated": "2014-05-13T09:42:31.000+0000" }, { "id": "305303", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\r\nMac OSX 10.9.3\r\nAppcelerator Studio, build: 3.3.0.201405121247\r\nTitanium SDK, build: 3.3.0.v20140515133312\r\nTitanium CLI, build: 3.3.0-dev\r\nAlloy: 1.4.0-alpha\r\n\r\nSpoke with Pedro, and the new expected outcome is:\r\n{code}\r\n[INFO] : New HTTP Client\r\n[INFO] : {}\r\n[INFO] : \"{\\\"foo\\\":\\\"foobar\\\",\\\"test\\\":[\\\"1\\\",\\\"2\\\"],\\\"array\\\":\\\"(\\\\n 1,\\\\n 2,\\\\n 3\\\\n)\\\"}{\\\"header\\\":{\\\"Host\\\":\\\"localhost\\\",\\\"X-Titanium-Id\\\":\\\"97f5e3cd-c752-400e-b9ad-ac692cab8429\\\",\\\"X-Requested-With\\\":\\\"XMLHttpRequest\\\",\\\"Accept\\\":\\\"*\\\\/*\\\",\\\"Content-Type\\\":\\\"application\\\\/x-www-form-urlencoded; charset=utf-8\\\",\\\"Content-Length\\\":\\\"84\\\",\\\"Accept-Language\\\":\\\"en-us\\\",\\\"Accept-Encoding\\\":\\\"gzip, deflate\\\",\\\"Connection\\\":\\\"keep-alive\\\",\\\"User-Agent\\\":\\\"Appcelerator Titanium\\\\/3.3.0 (iPhone Simulator\\\\/7.1; iPhone OS; en_US;)\\\"}}\"\r\n{code}\r\n\r\nClosing.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-16T17:21:03.000+0000", "updated": "2014-05-16T17:21:03.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }