get是向服务器获取数据,而post是向服务器传递数据。到底该怎么理解

GET,POST都是向服务器传数据。
说get是向服务器获取数据,而post是向服务器传递数据   其实是英文文档翻译的时候断章取义了,文档中可出这点(HTML规范在技术上定义了“GET”和“POST”之间的区别,前者意味着表单数据将(通过浏览器)编码成URL,而后者意味着表单数据将出现在消息正文中。但是规范也给出了使用建议,当表单处理是“幂等”时,应该使用“GET”方法,并且仅在那些情况下。作为一种简化,我们可以说“GET”基本上是为了获取(检索)数据,而“POST”可能涉及到存储或更新数据、订购产品或发送电子邮件等任何事情。
The HTML specifications technically define the difference between "GET" and "POST" so that former means that form data is to be encoded (by a browser) into a URL while the latter means that the form data is to appear within a message body. But the specifications also give the usage recommendation that the "GET" method should be used when the form processing is "idempotent", and in those cases only. As a simplification, we might say that "GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail.
所以一般GET使用传个ID值给服务器,让服务器通过ID取出数据,返回给客户端。

用户填写的数据,都用POST方法上传

但是实际开发中  不用这么细化.因为get不安全,大多都用post

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值