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

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

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

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

Let's say you submit a form, via POST, to /form. Then, that page uses pushState({}, '', ' #foo') 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's say you submit a form, via POST, to /form. Then, `location.hash = 'foo'` changes the URL to /form#foo, without reloading the page.

If the user presses refresh, what do _you_ think should happen?
I'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's more at
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'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't redirect. Round 1: Folks tend to agree on GETing the new URL. I agree. It's what Firefox & Chrome do. But Safari will POST to the _new_ URL, which is really weird.

https://twitter.com/jaffathecake/status/1385485629392293890
I'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't downgrade to GET.

All browsers POST in this case.

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

Latest Threads Unrolled: