[AC-3675] IOS Assertion failed: (self.url != nil), function -[APSHTTPRequest send], file /Users/kiat/titaniumModules/APSHTTPClient/APSHTTPClient/APSHTTPRequest.m
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-06-02T20:16:19.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | http, xhr |
Reporter | Suraj Datta |
Assignee | Shak Hossain |
Created | 2016-05-31T09:41:23.000+0000 |
Updated | 2016-06-02T20:16:19.000+0000 |
Description
Hello,
While making XHR Http call I'm getting following error:
Assertion failed: (self.url != nil), function -[APSHTTPRequest send], file /Users/kiat/titaniumModules/APSHTTPClient/APSHTTPClient/APSHTTPRequest.m, line 77.
At this point my app crashes.
The API call was suppose to return following JSON value.
{
"value": [
{
"Title": "Preventive Maintenance",
"URL": "https://api.myjson.com/bins/1gcuw"
},
{
"Title": "PTSA",
"URL": "https://api.myjson.com/bins/1ii0o"
},
{
"Title": "Principal",
"URL": "https://api.myjson.com/bins/44t2w"
},
{
"Title": "demo",
"URL": "https://api.myjson.com/bins/57dyw"
}
]
}
*Code Snippet:*
function initializingAPIcalls() {
Ti.API.info("Fn called");
var apiUrl = "Cannot Disclose";
var xhr = Ti.Network.createHTTPClient({
onload : function() {
response = this.responseText;
var _response = JSON.parse(response);
alert(_response);
},
onerror : function(e) {
Ti.API.info("Access Token error: " + e.code);
}
});
xhr.open('GET', apiUrl);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json; odata=nometadata");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSIsImtpZCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvdGF0YWNsYXNzZWRnZS5zaGFyZXBvaW50LmNvbUA3NWMzZTFkOS1lZGU2LTQxNzAtYTdlYi1mYjk3NWJhOTYyZTYiLCJpc3MiOiIwMDAwMDAwMS0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDBANzVjM2UxZDktZWRlNi00MTcwLWE3ZWItZmI5NzViYTk2MmU2IiwiaWF0IjoxNDY0Njg0NzYxLCJuYmYiOjE0NjQ2ODQ3NjEsImV4cCI6MTQ2NDY4ODY2MSwiYWN0b3IiOiIyN2FjYmJlMC0zZWRhLTQ5MWQtYTk0ZC00ZDVmMjVkODBlYThANzVjM2UxZDktZWRlNi00MTcwLWE3ZWItZmI5NzViYTk2MmU2IiwiaWRlbnRpdHlwcm92aWRlciI6InVybjpmZWRlcmF0aW9uOm1pY3Jvc29mdG9ubGluZSIsIm5hbWVpZCI6IjEwMDNiZmZkOTNiMTQ3ZmMifQ.AY21zJDQrk6lIxfNGfOb6euuTv21dv5CWRVpA6zL3iSLo2eqYxZL4Ul6cBv0Ugdm5gFpJ_PKJJY7C6_4sqFNQYGsBHqRWiqyaA-jeU0TlJvUTtLGKR0gJwY7TrYAnfk8FB_8IH2JhdTwa3SBVn_6MZ4smghfWucj89YVEaKUWhv3O_JjWU75Dd3jvTjYZ5W5SlSASku6GCo2OgS2qXv2RXOkdzcAC7qycyyYnhYgzTi5BbVSbuvRyQ3t_IWu50sKnxO4DhhN2oD9PYTiEaIWp1Bnh9NzR7MMEH2Au-eVrfQPty44s4xiQ21sHN9CBHbZXHDFsNxGduvNKPuf8yAPCA");
xhr.send();
}
Thanks.
Hello, Thanks 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. Regards, Sharif.
Hello, The issue is solved guys. Actually my apiURL was having some space in between which was working fine on Postman. Thanks for your response.