Is either GET or POST more secure than the other?

前端 未结 27 2730
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 05:13

When comparing an HTTP GET to an HTTP POST, what are the differences from a security perspective? Is one of the choices inherently more secure than the other? If so, why?

27条回答
  •  天命终不由人
    2020-11-22 05:41

    The difference between GET and POST should not be viewed in terms of security, but rather in their intentions towards the server. GET should never change data on the server - at least other than in logs - but POST can create new resources.

    Nice proxies won't cache POST data, but they may cache GET data from the URL, so you could say that POST is supposed to be more secure. But POST data would still be available to proxies that don't play nicely.

    As mentioned in many of the answers, the only sure bet is via SSL.

    But DO make sure that GET methods do not commit any changes, such as deleting database rows, etc.

提交回复
热议问题