开发者

HTTP Post on F5

Why is the default behavior of all the browsers to do HTTP POST when refreshing a page? And to submit the fo开发者_StackOverflow中文版rms.

This often leads to the well-known 'you're going to submit this page twice' sort of message. Which can easily(if not taken care of) execute a transcation twice (say if you're buying something).

Isn't this weird?


It's a quite standard behaviour because the state of the resource you're visiting was created by being Posted to.

Refreshing the page should re-initiate the page's state and thus a post is required.

Most of the time it's more ideal to use the Post/Redirect/Get pattern so that users are presented with a resource who's state is not dependent on a server Post.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜