zoukankan      html  css  js  c++  java
  • [HTTP]GET 和POST的区别

    1)提交数据的方式不同,GET通过在URL插入QueryString的方式,POST是在HTTP请求的Body中。

    2)提交的数据量限制不同,GET最多只能提交1024B,而POST没有限制。

    3) 安全性,GET提交的数据会暴露在URL中,而POST则是在Body中。

    4)安全的和幂等的,因为GET从服务端获取数据,因此它是安全的和幂等的。而POST则是要修改服务端的数据,因此它不是安全的和幂等的

    曾经遇到的与HTTP GET和POSTe 有关的问题:

    1.By default, Web service created via Visual Studio executes through HTTP Post method. When Post method is used, querystring is not visible. We need to configure our web service, so it works with HTTP GET and POST method. How can we do this?

    Go to web.config and add this code in system.web section.

    <webServices>
          <protocols>
            <add name=”HttpGet”/>
            <add name=”HttpPost”/>
          </protocols>

    </webServices>

    2.在ASP.NET获取GET和POST发送的数据的方式分别为:

    Page.Request.QueryString["name"]

    Page.Request.Form["name"] 

  • 相关阅读:
    iframe引入网页
    input同名
    混合框架
    <header><footer>引用
    <dl>
    凸包性质——cf1044C
    几何求叉积+最短路——cf1032D
    fresco 设置资源路径时的一个坑
    马拉车+贪心——cf1326D
    【模板变形】凸壳二分+斜率优化dp——cf1083E
  • 原文地址:https://www.cnblogs.com/fuhongwei041/p/1702593.html
Copyright © 2011-2022 走看看