使用POST而不是GET有什么不好吗? [英] Is there anything not good using POST instead of GET?

查看:116
本文介绍了使用POST而不是GET有什么不好吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道POST和GET之间的区别,但是如果我使用POST而不是GET,除了不符合W3C标准外什么都不好?
什么东西效率低下,不安全或者其他什么?

I know the difference between POST and GET, however if I used POST instead of GET, anything not good besides not up to W3C standards? Anything inefficiency, insecurity or anything else?

推荐答案

请参阅deceze的答案:

See the answer from deceze:

POST requests can't be bookmarked.

在我所做的所有采访中,我所做的所有教学,都是最好的开始的地方。还有很多,但从此开始。

In all the interviews I've done, all the teaching I've done, this is the best place to start. There's a lot more, but start with this.

忽略任何有关安全性的人。一个好的黑客可以很容易地将POST更改为GET。

Ignore anything anyone says about security. A good hacker can change POST to GET easily.

如果知道这一点,知道POST更改数据(添加一个成员资格或收取信用卡),而GET只提取数据(搜索红色衬衫)。浏览器的制造商使他们的浏览器对POST和GET的结果表现不同。 POST的结果有副作用,您可能不想重复(例如添加其他会员资格或对信用卡双重收费)。

If you get this far, know that POST changes data (adds a membership, or charges a credit card), whereas GET only fetches data (searches for red shirts). The makers of browsers make their browsers behave differently for the results of POST vs GET. The results of POST have side effects that you may not want to repeat (such as adding another membership or double charging a credit card).

如果您了解本文,然后阅读关于POST-Redirect-GET模式,并理解它。 (然后知道GET具有URL长度限制,并且在这种情况下您可能需要求助于POST。)

If you understand THIS, then read about the POST-Redirect-GET pattern, and understand it well. (Then know that GET has a URL length limit, and that you may need to resort to POST in this case.)

这篇关于使用POST而不是GET有什么不好吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆