My AngularJS $http post requests to my C# WebAPI restful service fail on Windows 8.1 in Internet Explorer 11. Firefox and Chrome both work.
Some more details:
- The IT department says our network has no proxy
- All 'automatically detect' and 'use proxy' settings are unchecked in all browsers
- The requests fail to IIS both on my localhost and running the site and service on a local server
- Enhanced protection mode of IE11 is off
- The request's connection header is 'keep-alive' (I tried 'close' too and it still failed)
- Sometimes one request will succeed and only from the second request will everything fail
- No error is shown - the request in IE's network tab just says 'Pending' and all headers and body are blank
- I'm using HTTP, not HTTPS
- I've tried the meta tag 'X-UA-Compatible' IE9 and Edge
- The requests fail for colleagues using IE11 on their machines too
- All calls in all browsers work perfectly when Fiddler is running
- Visual Studio 2013 browser link is turned off (so the SignalRArtery JS file isn't constantly making calls to the server and interfering with testing)
My AngularJS request call looks like this:
var url = UrlService.GetUrlOfApi() + 'Account/SignIn';
var postData = { 'username' : username, 'password' : password };
$http(
{
'url': url,
'data': postData,
'method': 'POST'
})
.success(function (data)
{
...
My C# service looks like this:
[RoutePrefix("Account")]
[AllowAnonymous]
public class AccountController : BaseController
{
[ResponseType(typeof(SecureResponseModel))]
[Route("SignIn")]
[HttpPost]
public IHttpActionResult SignIn(HttpRequestMessage request)
{
try
{
var userSignInDetails = GetPostData<AuthenticationRequestMessage>(request);
var token = _hisManager.AuthenticateUser(userSignInDetails.Username, userSignInDetails.Password);
return new SignInResponseMessage(token, ApiErrorCode.success, Request);
}
catch(APIException e)
{
throw;
}
}
This is what a failing call looks like in IE11, totally blank:
This is what a successful calls looks like when Fiddler is running:
Can anyone recommend any other settings to check or things to try please?