现在的位置: 首页 > 综合 > 正文

http 中的post和get方法

2013年10月18日 ⁄ 综合 ⁄ 共 937字 ⁄ 字号 评论关闭

在http中可以使用post和get与服务器交流信息。

在html中的实现:

通过post方式提交数据:

 

实际发送的信息为

POST / HTTP/1.1
Host: www.****.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
Gecko/20050225 Firefox/1.0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 40
Connection: Keep-Alive
     (----此处空一行----)
input1=nihao&input2=nihuai

而通过get方法:
例如:

他发送的信息为

 

GET
/target.php
?
input1=nihao&input2=nihuai
HTTP/1.1
Host: www.***.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
Gecko/20050225 Firefox/1.0.1
Connection: Keep-Alive

 

因此get的信息会在地址栏显示,而post的数据不会。

若想查看post的信息简单的网络抓报就可以了。

你若使用firefox 可以安装HttpFox 这个插件检测该信息。

 

抱歉!评论已关闭.