difference between http get and post

1 用get的地方

在浏览器中输入url直接访问资源时,用get。get是通过url传参的。

2 用post的地方

2.1 url长度超限时

post是将参数放在http body中的,因此对参数的长度是没有要求的,但是一般的服务器对url的长度都是有要求的,apache http服务器要求url长度不超过4000个字符。

如果参数长度超了,那么就必须要用post。

2.2 对加密要求很高时

get方式传参数会泄漏重要信息。

原文地址:https://www.cnblogs.com/hustdc/p/6942470.html