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.