Chris Westbrook
Chris Westbrook

Reputation: 2110

web service being called twice with jquery ajax function

I am using the $.ajax function in jquery to make a call to an asmx service. When I look at the requests from fiddler, I see two requests for each call I make. One has a content type of text/html which of course returns a 401 not authorized status, and the other one has the correct content type and returns the correct data. Can anyone tell me why it is doing this and how I can fix it or if it needs fixing?

Upvotes: 0

Views: 1673

Answers (1)

Otávio Décio
Otávio Décio

Reputation: 74290

That is normal when you have anonymous requests disabled (you probably have Windows authentication enabled). The 401 is a challenge asking for the credentials.

Upvotes: 3

Related Questions