I am working on an ionic application and use it $httpto retrieve data from a web service. I tested and worked fine on the browser, but I donβt know why it doesnβt work on my Android mobile phone, it just continues to process and after 3 - 5 minutes it shows:
ionic.bundle.js:25000 POST http://xyz-domain.com/api/ net::ERR_CONNECTION_TIMED_OUT
Even I installed the plugin cordova-plugin-whitelist, but still getting the same.
My code is:
var ApiURL = 'http://xyz-domain.com/api/';
$http({
url: ApiURL,
method: 'POST',
data: 'action=activate&app_secret=123456',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(function(res){
alert(res);
});
Can someone tell me how I can solve this problem?
thank
source
share