• 一个测试HTML Method的例子


    测试用代码:

    <form method="POST">
        First name: <input type="text" name="fname" />
        Last name: <input type="text" name="lname" />
        <input type="submit" value="Submit" />
    </form>

    使用GET时传送给服务的数据:

    GET /phpsocket/method.php?fname=steven&lname=jobs HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
    Referer: http://localhost/phpsocket/method.php?fname=steven&lname=jobs
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
    Host: localhost
    Connection: Keep-Alive

    使用POSTT时传送给服务的数据:

    POST /phpsocket/method.php HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
    Referer: http://localhost/phpsocket/method.php
    Accept-Language: zh-cn
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
    Host: localhost
    Content-Length: 23
    Connection: Keep-Alive
    Cache-Control: no-cache
    Cookie: ZDEDebuggerPresent=php,phtml,php3
    
    fname=steven&lname=jobs

    两者比较结果:
    1. GET提交时网址发生了变化,POST提交时网址没有变化;
    2. GET数据以网址QueryString的方式提交给服务器,POST数据以Content的方式提交给服务器。

  • 相关阅读:
    【数据中心】大二层网络
    数通ARP协议
    数通链路聚合技术
    【数据中心】VXLAN技术
    数通交换机的数据平面、控制平面、管理平面
    数通交换机环路问题
    数通VRRP协议
    数通以太网交换机工作原理
    数通堆叠技术
    查看机器位数
  • 原文地址:https://www.cnblogs.com/eastson/p/2886956.html
Copyright © 2020-2023  润新知