{ "id": "160611", "key": "AC-3675", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-06-02T20:16:19.000+0000", "created": "2016-05-31T09:41:23.000+0000", "labels": [ "http", "xhr" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-06-02T20:16: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": [], "description": "Hello,\r\n\r\nWhile making XHR Http call I'm getting following error:\r\n\r\n{code:java}\r\nAssertion failed: (self.url != nil), function -[APSHTTPRequest send], file /Users/kiat/titaniumModules/APSHTTPClient/APSHTTPClient/APSHTTPRequest.m, line 77.\r\n{code}\r\n\r\nAt this point my app crashes.\r\n\r\nThe API call was suppose to return following JSON value.\r\n\r\n{code:java}\r\n{\r\n \"value\": [\r\n {\r\n \"Title\": \"Preventive Maintenance\",\r\n \"URL\": \"https://api.myjson.com/bins/1gcuw\"\r\n },\r\n {\r\n \"Title\": \"PTSA\",\r\n \"URL\": \"https://api.myjson.com/bins/1ii0o\"\r\n },\r\n {\r\n \"Title\": \"Principal\",\r\n \"URL\": \"https://api.myjson.com/bins/44t2w\"\r\n },\r\n {\r\n \"Title\": \"demo\",\r\n \"URL\": \"https://api.myjson.com/bins/57dyw\"\r\n }\r\n ]\r\n}\r\n{code}\r\n\r\n\r\n\r\n*Code Snippet:*\r\n\r\n{code:java}\r\n\r\nfunction initializingAPIcalls() {\r\n\tTi.API.info(\"Fn called\");\r\n\r\nvar apiUrl = \"Cannot Disclose\";\r\n\r\nvar xhr = Ti.Network.createHTTPClient({\r\n\r\n\t\tonload : function() {\r\n\r\n\t\t\tresponse = this.responseText;\r\n\r\n\t\t\tvar _response = JSON.parse(response);\r\n\r\n\t\t\talert(_response);\r\n\r\n},\r\n\r\n\t\tonerror : function(e) {\r\n\r\n\t\t\tTi.API.info(\"Access Token error: \" + e.code);\r\n\r\n\t\t}\r\n\t});\r\n\r\n\txhr.open('GET', apiUrl);\r\n\txhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\n\txhr.setRequestHeader(\"Accept\", \"application/json; odata=nometadata\");\r\n\txhr.setRequestHeader(\"Authorization\", \"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSIsImtpZCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvdGF0YWNsYXNzZWRnZS5zaGFyZXBvaW50LmNvbUA3NWMzZTFkOS1lZGU2LTQxNzAtYTdlYi1mYjk3NWJhOTYyZTYiLCJpc3MiOiIwMDAwMDAwMS0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDBANzVjM2UxZDktZWRlNi00MTcwLWE3ZWItZmI5NzViYTk2MmU2IiwiaWF0IjoxNDY0Njg0NzYxLCJuYmYiOjE0NjQ2ODQ3NjEsImV4cCI6MTQ2NDY4ODY2MSwiYWN0b3IiOiIyN2FjYmJlMC0zZWRhLTQ5MWQtYTk0ZC00ZDVmMjVkODBlYThANzVjM2UxZDktZWRlNi00MTcwLWE3ZWItZmI5NzViYTk2MmU2IiwiaWRlbnRpdHlwcm92aWRlciI6InVybjpmZWRlcmF0aW9uOm1pY3Jvc29mdG9ubGluZSIsIm5hbWVpZCI6IjEwMDNiZmZkOTNiMTQ3ZmMifQ.AY21zJDQrk6lIxfNGfOb6euuTv21dv5CWRVpA6zL3iSLo2eqYxZL4Ul6cBv0Ugdm5gFpJ_PKJJY7C6_4sqFNQYGsBHqRWiqyaA-jeU0TlJvUTtLGKR0gJwY7TrYAnfk8FB_8IH2JhdTwa3SBVn_6MZ4smghfWucj89YVEaKUWhv3O_JjWU75Dd3jvTjYZ5W5SlSASku6GCo2OgS2qXv2RXOkdzcAC7qycyyYnhYgzTi5BbVSbuvRyQ3t_IWu50sKnxO4DhhN2oD9PYTiEaIWp1Bnh9NzR7MMEH2Au-eVrfQPty44s4xiQ21sHN9CBHbZXHDFsNxGduvNKPuf8yAPCA\");\r\n\txhr.send();\r\n\r\n}\r\n{code}\r\n\r\n\r\nThanks.\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "IOS Assertion failed: (self.url != nil), function -[APSHTTPRequest send], file /Users/kiat/titaniumModules/APSHTTPClient/APSHTTPClient/APSHTTPRequest.m", "creator": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "subtasks": [], "reporter": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "environment": "SDK : 5.2.2.G.A\r\nDeployment Target : IPad / IPhone", "comment": { "comments": [ { "id": "387185", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, \r\n\r\nThanks for creating the ticket. Please provide a full reproducible code and steps to test the issue in our environment. When we are able to reproduce the issue we will provide a fix. \r\n\r\nRegards,\r\nSharif.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-05-31T17:53:56.000+0000", "updated": "2016-05-31T17:53:56.000+0000" }, { "id": "387254", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Hello,\r\n\r\nThe issue is solved guys.\r\nActually my apiURL was having some space in between which was working fine on Postman.\r\n\r\nThanks for your response.", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-06-01T07:22:31.000+0000", "updated": "2016-06-01T07:22:31.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }