zoukankan      html  css  js  c++  java
  • idempotent幂等 POST GET 修改服务器数据

    GET,POST都是向服务器传数据。说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.

    HTML规范在技术上定义了“GET”和“POST”之间的区别,前者意味着表单数据将(通过浏览器)编码成URL,而后者意味着表单数据将出现在消息正文中。但是规范也给出了使用建议,当表单处理是“幂等”时,应该使用“GET”方法,并且仅在那些情况下。作为一种简化,我们可以说“GET”基本上是为了获取(检索)数据,而“POST”可能涉及到存储或更新数据、订购产品或发送电子邮件等任何事情。

    所以一般GET使用传个ID值给服务器,让服务器通过ID取出数据,返回给客户端。

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

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

  • 相关阅读:
    WebSocket使用及优化(心跳机制与断线重连)
    JS案例:触底懒加载
    你知道近来年大火的DDD是如何兴起的吗?以及与微服务的关系
    Sql Server的Cross Apply用法
    跨域信息传递解决方案
    【转】理解字节序
    NATAPP优惠码
    <学习笔记>筛法
    <学习笔记>线性基
    【react + BizCharts】
  • 原文地址:https://www.cnblogs.com/woaiheniunai/p/15488036.html
Copyright © 2011-2022 走看看