SubbuEatsApple
iPF Noob
Hi,
We are developing a mobile app to be ported to the Android and IPAD platforms. The idea is to use the same code and create APK and IPA files as deployable apps for Android and IPAD respectively using Phonegap build process.
The app makes an Async xmlHttpRequest call to a REST based HTTPS URL using POST Method. The response is in JSON format.
The call works well from the app deployed on the Android platform and gets back with proper response and HTTP status code(200). But, the same app call fails from the IPAD. It returns an xmlHttpRequest response status code 0. Looking at this, there does not seem to be an issue of Cross-Domain here since the call from the app from Android works well to the same URL.
Any ideas as to what could be the problem with the call in IPAD?
Here is the code snippet used:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', url, true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
var myform = document.forms[0];
var reqBody = getRequestBody(myform);
xmlhttp.send(reqBody);
xmlhttp.onreadystatechange = function() {
// If state == 4, read the status code.
}
Thanks a lot!
We are developing a mobile app to be ported to the Android and IPAD platforms. The idea is to use the same code and create APK and IPA files as deployable apps for Android and IPAD respectively using Phonegap build process.
The app makes an Async xmlHttpRequest call to a REST based HTTPS URL using POST Method. The response is in JSON format.
The call works well from the app deployed on the Android platform and gets back with proper response and HTTP status code(200). But, the same app call fails from the IPAD. It returns an xmlHttpRequest response status code 0. Looking at this, there does not seem to be an issue of Cross-Domain here since the call from the app from Android works well to the same URL.
Any ideas as to what could be the problem with the call in IPAD?
Here is the code snippet used:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', url, true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
var myform = document.forms[0];
var reqBody = getRequestBody(myform);
xmlhttp.send(reqBody);
xmlhttp.onreadystatechange = function() {
// If state == 4, read the status code.
}
Thanks a lot!