We have the following issue with our AngularJS application. We send a request via tha Angular $http Service like this:
var req = {
method: 'POST',
url: apiUrl + 'reg',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'ApiToken': apiToken
},
data: {
'regCode': regCode
},
responseType: 'json'
};
return $http(req);
The API is an HTTPS Url. The page which sends the request with the code above is also served by HTTPS.
The request works fine in Chrome or Firefox but most of the time the request fails in IE11 (11.0.9600.18059 Update 11.0.24) with the following message:
SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3
The Network tab in IE shows the request has taken < 1ms and the Result says (Aborted) which means the request never has started from IE side.
The fun part is that if I am doing the request without AngularJS like this:
var req = new XMLHttpRequest();
req.open('POST', url);
req.setRequestHeader('ApiToken', apiToken);
req.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
req.send(json);
everything works fine in IE. Also it seems the requests via GET works fine too.
Any idea what could be wrong or what I can try ?