An example of testing the HTML Method

Source: Internet
Author: User

TestingCode:

 
<Form method = "Post">First name: <Input type = "text" name = "fname"/>Last name: <Input type = "text" name = "lname"/> <input type = "Submit" value = "Submit"/> </form>

 

Data transmitted to the service when get is used:

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 = jobsaccept-language: ZH-cnaccept-encoding: gzip, deflateuser-AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; sv1 ;. net CLR 2.0.50727 ;. net CLR 3.0.20.6.2152 ;. net CLR 3.5.30729 ;. net4.0c ;. net4.0e) Host: localhostconnection: keep-alive

 

Data sent to the service when postt is used:

Post/phpsocket/method. php http/ 1.1Accept: 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. phpaccept-language: ZH-cncontent-type: Application/X-WWW-form-urlencodedaccept-encoding: gzip, deflateuser-AGENT: Mozilla/4.0 (compatible; MSIE 6.0; windows NT 5.1; sv1 ;. net CLR 2.0.50727 ;. net CLR 3.0.20.6.2152 ;. net CLR 3.5.30729 ;. net4.0c ;. net4.0e) Host: localhostcontent-length: 23 connection: Keep-alivecache-control: No-cachecookie: zdebuggerpresent = PHP, phtml, php3fname = Steven & lname = jobs

 

comparison results:
1. the URL is changed when the GET request is submitted, and the URL is not changed when the POST request is submitted.
2. get data is submitted to the server as querystring, and post data is submitted to the server as content.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.