Reputation: 338158
I have a web page that implements the post/redirect/get pattern to avoid double posts in a simple CRUD application.
The intended request/response sequence here is:
POST
302 Moved Temporarily
and a Location
headerGET
This is how it is supposed to work – and it does, in Chrome for example.
Internet Explorer 9, however, sends step 3 as a POST
, too (including the complete set of form data!). Why? What should I do to make it use GET
?
I should add that apart from the query string the redirect goes to the same location as the form target.
I've tried:
Location
headerUpvotes: 10
Views: 3511
Reputation: 2800
I noticed similar behavior. Turns out IE11's internal debugger was reporting a POST but using a third party app (Fiddler) it reported the request as being a GET. If you see a POST in response to a 303/302, double check it with an outside app.
Upvotes: 2
Reputation: 7299
I'm not sure but it seems like IE9 doesn't actually sent "POST" after redirect 30x - it just displays it in his internal debugger.
Upvotes: 3
Reputation: 42017
The correct status code if you want a GET is 303, although 301 and 302 will also do what you want in common browsers.
If this is not working, something else probably is wrong. An HTTP trace would be helpful for finding what is wrong.
Upvotes: 4