Why does the back button not work with HTTP POST?

感情迁移 提交于 2019-12-06 18:27:27

Back isn't a special request that goes to the server. Back just navigates to the previous page, same as if you just entered the url in the navigation bar and hit go. It's really the same thing as a reload which is the same as a basic page request from the server's point of view. They're all just GET requests.

When you hit back on a page that used a post, it resends a post rather than a get. Generally browsers have built in protections against that ("Are you sure you want to go back? Browser will resend previously submitted information").

The reason it doesn't reload posts like that is because, like you said, it doesn't want to resend the information used to get that page to the server, because it'll double post something, or double buy something.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!