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"] 

  • 相关阅读:
    Python数据结构与算法(几种排序)
    jquery元素节点操作
    Jquery事件委托
    Jquery事件冒泡
    jquery事件
    尺寸相关、滚动事件
    jquery属性操作
    jquery选择器
    JavaScript面向对象
    jQuery powerFloat万能浮动层下拉层插件
  • 原文地址:https://www.cnblogs.com/fuhongwei041/p/1702593.html
Copyright © 2011-2022 走看看