It appears
jQuery.ajax automatically performs a
GET when receiving a 303 response with a
Location header:
- jQuery.ajax({
- url: "/login", // returns 303 with Location: /home
- type: "POST",
- data: {
- username: "foo",
- password: "bar"
- },
- success: function() { console.log("foo", this, arguments); },
- error: function() { console.log("bar", this, arguments); },
- complete: function() { console.log("baz", this, arguments); }
- });
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... !?