Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49224

HTTP GET over angular and also XMLHttpRequest throws strange error on cordova device

$
0
0

@mburger81 wrote:

We do a simple GET over angulars HTTP library to an url like https://smart.blabla.com.
If we run this with ionic serve every thing is fine, but if we run this with ionic cordova emulate android we get a strange error. We tried also to run this on a new clean ionic project, we have the same error.

We test it to make a plain XHR call, and there we get also errors. This is an example of our call:
var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://smart.blabla.com', true); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { console.log(xhr.responseText) } }; xhr.withCredentials = true; xhr.send('{}');

The only thing a new about this error, the POST is never send, the error is on client side. And as mentioned before if I do the same thing in ionic serve anything is working fine.

in my config.xml the access origin is configured like this
<access origin="*" />

Some ideas?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>