views:

659

answers:

4

What causes Firefox to follow a POST request with a GET request when submitting a form via the POST method? The GET method is sent to the same url as the POST method but without the request parameters.

If you change the form method to GET, it will result in two identical GET requests.

A: 

Probably there is some javascript involved. The form is submitted as a result of an onclick event in an anchor with: href="..." onclick="..form.submit()"

Frans
I forgot to mention that this still occurs with JavaScript disabled.
+3  A: 

This is a bug in Firefox 3. This happens when the response to the POST contains an image tag with an empty source attribute. eg <img src=""/>

Is this bug documented somewhere?
Taylor Leese
A: 

How are you determining there are extraneous GET requests? I'd like to see more specifics on the scenario. Can you post some excerpts of the HTML or specific web site examples?

spoulson
+1  A: 

The URL POSTed to might be returning a Redirect -- that would cause a GET. This is commonly done so that the page can be refreshed without reposting.

Lou Franco