Jquery ajax call for asp.net mvc application receiving two unauthorized reponses, then Ok

I am making the following jQuery ajax call for an asp.net mvc controller that works, however on the firebug console it seems to be executed three times. The first two times it returns 401 Unauthorized, and the last time it returns 200 Ok. Can anyone shed light on what happens when I make this request and how I can stop outgoing calls from failing.

$.ajax({ type: 'POST', url: '/Core/GetVariableSet', dataType: 'json', data: {}, success: function(response) { thisObject.Date = new Date(response.Date); thisObject.UserId = response.UserId; thisObject.UserName = response.UserName; }, error: function(XMLHttpRequest, textStatus, errorThrown) { Util.errorhandling.AJAXError($('#main'), 'Error Getting Variables', XMLHttpRequest, textStatus, errorThrown); } }); 
+7
jquery authentication ajax asp.net-mvc
source share
2 answers

I noticed that this happened to me when I debugged Firefox. The fix I found is to add the site to the list "network.automatic-ntlm-auth.trusted-uris" in firefoxs about: config.

Be sure to enable the port if it is a local development server causing problems.

+2
source share

It is difficult to say outside the context in which it is executed. That is, when executions are carried out, and why he flies three times.

The fact that he was tried before receiving 200 makes me suspect that there is some kind of reissue. Perhaps something did not finish the download?

Read error 401 to see if it sheds light on you.

http://www.checkupdown.com/status/E401.html

0
source share

All Articles