Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sometimes, I want to reload a page in Safari, but I submitted a form on the previous page. Is there any way, short of entering the URL bar (either with a mouse or with +L and pressing return), to reload the page without resending the form?

share|improve this question

1 Answer 1

Strictly speaking, no. For simple HTML forms using Common Gateway Interface (CGI), the web page you see is the output of a process which uses the form data as an input. Put another way, the server needs the form data to generate the page. There a lot of ways to get around that using back-end databases, cookies, javascript, etc. But generally speaking: no-form, no-result.

You mentioned clicking in the URL bar and pressing return, but if the form uses the GET method (form data in the URL itself), then clicking in the URL bar and pressing return does effectively resend it. However, if the form uses the POST method (form data sent in the HTTP request body), then clicking the URL bar and pressing will not send the form data and so the page will not be regenerated.

Note that if you tell Safari to reload a form-result page, it will usually ask you to confirm that you really want to do that, then resend the form data. The reason it asks is that there may well be some side-effect of the form (like charging your credit card) which you might not want to repeat. That's poor CGI design, but it happens.

share|improve this answer
    
I knew most of that, but thank you for the detailed information! What I'm really looking for is a way to get Safari to do the same thing as resending the URL with a command-R. –  timothymh Apr 18 '12 at 21:07
    
What's wrong with command-R? (I mean, there are a lot of things wrong with command-R, but what are you specifically trying to avoid?) –  Seth Noble Apr 18 '12 at 21:54
    
It warns me about resending the form. I then have two options: Resend (I don't want to resend it) and Cancel (I do want to reload it). –  timothymh Apr 18 '12 at 22:03
1  
Those really are you're only two choices. Without the form data, the server has no way of knowing what to send to you. –  Seth Noble Apr 19 '12 at 1:31
    
It does it when I resend the URL! That's all I want to do. –  timothymh Apr 19 '12 at 10:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.