I am using nativescript to develop an android application. 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 then block will never be executed. And sometimes the catch starts and throws a network error. But in any case, the request is sent, and the response is smoothly received according to my tcpdump entries.
So it seems that nativescript has filtered the answer for some reason.
Has anyone experienced this?
source share