Let& #39;s say you submit a form, via POST, to /form. Then, that page uses pushState({}, & #39;& #39;, & #39;/foo& #39;) to change the URL to /foo, without reloading the page.

If the user presses refresh, what do _you_ think should happen?
Round 2:

Let& #39;s say you submit a form, via POST, to /form. Then, `location.hash = & #39;foo& #39;` changes the URL to /post #foo, without reloading the page.

If the user presses refresh, what do _you_ think should happen?
Round 3:

Let& #39;s say you submit a form, via POST, to /form. Then, that page uses pushState({}, & #39;& #39;, & #39; #foo& #39;) to change the URL to /form #foo, without reloading the page.

If the user presses refresh, what do _you_ think should happen?
Round 4: (or, what I was meant to write for round 2)

Let& #39;s say you submit a form, via POST, to /form. Then, `location.hash = & #39;foo& #39;` changes the URL to /form #foo, without reloading the page.

If the user presses refresh, what do _you_ think should happen?
I& #39;ll reveal what browsers do, and what I think they should do, when the polls close. In the meantime, if you like quizzes like this, there& #39;s more at https://www.youtube.com/watch?v=W6lvQvdeF8U">https://www.youtube.com/watch...
Ok… Firstly, ignoring the edge cases above, browsers will generally try to re-POST when you hit refresh on a page generated via POST, although they& #39;ll show a prompt beforehand.

To avoid this, sites generally serve a 303 redirect after a POST to downgrade to GET.

But, we still need to spec what happens in cases where the server doesn& #39;t redirect. Round 1: Folks tend to agree on GETing the new URL. I agree. It& #39;s what Firefox & Chrome do. But Safari will POST to the _new_ URL, which is really weird.

https://twitter.com/jaffathecake/status/1385485629392293890">https://twitter.com/jaffathec...
I& #39;m going to spec what Chrome & Firefox do here. It seems like the most sensible thing.

Moving on…
Round 2: Folks are less sure here, but tend to agree that it should re-POST. I also agree. Setting location.href (and other properties) is like clicking a link, and in-page navigations shouldn& #39;t downgrade to GET.

All browsers POST in this case.

https://twitter.com/jaffathecake/status/1385503245641134080">https://twitter.com/jaffathec...
You can follow @jaffathecake.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: