title: jQuery AJAX post receives 405 error (HTTP verb POST not allowed)
body: <p>I have the following jQuery post to an ASP.NET webmethod:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "AjaxWebMethods.aspx/UpdNote",
      contentType: "application/json; charset=utf-8",
      data: "{'ID' : '" + id + "', 'note' : '" + note + "' }",
      dataType: "json",
      success: UpdNote_Success,
      error: AjaxError
  });
  </code></pre>
  
  <p>And the web method is declared:</p>
  
  <pre><code>[System.Web.Services.WebMethod(enableSession: true)]
  public static int UpdNote(int ID, string note) {
      // business logic that eventually returns a number, but simplifying
      // ... for the sake of brevity
      int retNum = 99;
  
      return retNum;
  }
  </code></pre>
  
  <p>The jQuery post and the web method both work wonderful in a Windows Authenticated environment (ie - users are authenticated by LDAP). However, I recently had to move the website to a server that uses RSA (two-factor authentication, pin and token code) for authenticating users in order to gain access to the site. And what I'm seeing now is that all my jQuery posts are returning "405 error". </p>
  
  <p>Cross-site requests comes to mind, obviously, but none of that is going on here. All of the jQuery AJAX posts are using web methods that are declared in the AjaxWebMethods.aspx, which page resides in the site's own domain.</p>
  
  <p>Thanks in advance for any help or suggestions!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Using Fiddler in IE8 gives me a little more information. The error code that it returns is still 405, but the server error is more descriptive. The server error is "The HTTP verb POST used to access path '/AjaxWebMethods.aspx/UpdNote' is not allowed."</p>
  
  <p>I did try changing the type parameter of the ajax request to GET, but I get a 404 instead (The resource cannot be found).</p>
  
  <p>Also, forgot to mention that this is over SSL (although I don't expect this would make a difference).</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>After extensive testing (and extensive help from the astute members of stackoverflow) I've determined that 405 error is directly related to the Application Pool that the website is using, and more specifically to the Managed Pipeline Mode that is selected for the Application Pool. </p>
  
  <p>If I use an Application Pool that targets v4.0 (.NET Framework) and Integrated (Managed Pipeline Mode) then my AJAX post works just fine. But if I use an Application Pool that targets v4.0 and Classic (Managed Pipeline Mode) then I get the 405 error.</p>
  
  <p>So at this point I'm still looking for a solution to this question, although I've been able to home-in on the problem. </p>