I am using the nativescript to develop an app for android. I have something like
var fetchModule = require("fetch");
fetchModule.fetch("http://202.120.227.11/")
.then(function(resp){
console.log(JSON.stringify(resp));
return resp;
})
.catch(function(err){
console.log(JSON.stringify(err));
return err;
});
but the then block never gets executed.
And sometimes the catch block gets executed and give a network error.
But in either case, the request is sent and the response is smoothly received according to my tcpdump records.
So, it seems the nativescript has filtered the response for some reason.
Has anybody experienced that?