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

posted on 2010-04-01 21:14  James.H.Fu  阅读(745)  评论(0编辑  收藏  举报

导航