79643072

Date: 2025-05-28 22:26:30
Score: 1.5
Natty:
Report link

The answer is Yes!

You can get the contents from fetch, change the visible location with function history.pushState() and totally replace document.documentElement.innerHTML with fetched data. The only thing that will be lost - some http headers which could affect the behavior of the page.

The answer is No!

In most cases once you received the response from server on your POST-request its state will never be the same. If you just walk to new location /someform server will not receive POST and the reply will differ from the reply you already consumed by fetch. Of course there are some servers that always reply the same ( something like 'OK'). But don't get your hopes up.

So, which answer do you prefer?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Solt