suppressing automatic GET in response to 303 HTTP status

suppressing automatic GET in response to 303 HTTP status

It appears jQuery.ajax automatically performs a GET when receiving a 303 response with a Location header:

  1. jQuery.ajax({
  2.     url: "/login", // returns 303 with Location: /home
  3.     type: "POST",
  4.     data: {
  5.         username: "foo",
  6.         password: "bar"
  7.     },
  8.     success: function() { console.log("foo", this, arguments); },
  9.     error: function() { console.log("bar", this, arguments); },
  10.     complete: function() { console.log("baz", this, arguments); }
  11. });

This will result in a GET to /home after the POST, before any callbacks are processed.
How can I suppress this automatic 303 handling?
(using jQuery v1.4.2 on Firefox)

Thanks!


Update: It appears this is not directly related to jQuery, but rather the underlying XHR. There might still be a way to control this though... !?










    • Topic Participants

    • fndo