The difference between get and post two ways to submit

Source: Internet
Author: User

How to submit: Get commit.
Address bar:
Http://10.1.31.69:9090/?user=abc&psw=123&repsw=123&sex=nan&tech=java&tech=html&c
Ountry=cn
GET/?USER=ABC&PSW=123&REPSW=123&SEX=NAN&TECH=JAVA&TECH=HTML&COUNTRY=CN 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,/
accept-language:zh-cn,zu;q=0.5
Accept-encoding:gzip, deflate
323
user-agent:mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; INFOPATH.2)
host:10.1.31.69:9090
Connection:keep-alive
Submission Method: POST
Address bar: http://10.1.31.69:9090/
post/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,/
accept-language:zh-cn,zu;q=0.5
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; INFOPATH.2)
host:10.1.31.69:9090
content-length:68
Connection:keep-alive
Cache-control:no-cache
User=hahah&psw=8989&repsw=8989&sex=nv&tech=html&tech=css&country=usa
What is the difference between a get commit and a post submission?
1,
Get commits, and the submitted information is displayed in the Address bar.
Post submission, the submitted information is not displayed in the Address bar.
2,
Get commits are not secure for sensitive data information.
Post submission, security for sensitive information.
3,
Get commits, not for big data, because the address bar storage volume is limited.
Post submission, you can submit large volumes of data.
4,
Get commits, encapsulating the information in the request line of the request message.
Post submission, encapsulating the information in the request body.
A difference in the service side.
If you submit Chinese to the Tomcat server, the server will decode with iso8859-1 by default, and it will appear garbled.
The code can be encoded by iso8859-1, and then decoded with the specified Chinese code table.
This approach is valid for both get and post submissions.
324
However, for the post submission method submitted in Chinese, there is another solution is to directly use the server side of an object
The Setcharacterencoding method of the Request object directly sets the specified Chinese code table so that the Chinese data can be parsed out
To.
This method decodes only the data in the request body.
Summary: Form submission, we recommend the use of post.
Three ways to interact with the server:
1, enter the URL address in the Address bar. Get
2, hyperlinks. Get
3, form. Get and Post
If an enhanced check is performed on the client (as long as there is a component content error, it is not possible to continue the commit, only the full pair can be committed)
Q, does the server need to verify after receiving the data?
Answer: Need, for security.
If the server does an enhanced checksum, does the client still need to verify?
A: need, because to improve the user's Internet experience, reduce the pressure on the server side.

<html><head><meta http-equiv="Content-type" Content="text/html; CHARSET=GBK "><!--meta http-equiv= "Refresh" content= "3;url=http://www.sina.com.cn"/--><title>Untitled Document</title></head><body><form Action="http://10.1.31.69:9090" method="POST"><table Border="1" bordercolor= "#0000ff" cellpadding =Ten cellspacing=0Width=><tr><th colspan="2">Registration Form</th></tr><tr><TD>User name:</td><TD><input type="text" name="user" /></td></tr><tr><TD>Enter Password:</td><TD><input type="password" name="PSW" /></td></tr><tr><TD>Confirm Password:</td><TD><input type="password" name="REPSW" /></td></tr><tr><TD>Select Gender:</td><TD><input type="Radio" name= "sex" value="Nan" />Man<input type="Radio" name="Sex" value= "NV" />Female 325</td></tr><tr><TD>Select technology:</td><TD><input type="checkbox" name="Tech" value ="java" />Java<input type="checkbox" name= "Tech" value="html" />Html<input type="checkbox" name="Tech" value= "css" />Css</td></tr><tr><TD>Select Country:</td><TD><Select name="Country"><option value="None">--Select country--</option><option value="USA">--United States--</option><option value="en">--Britain--</option><option value="cn">--China--</option></Select></td></tr><tr><th colspan="2"><input type="Reset" value="purge data" /><input type="Submit" value="Submit data" /></th></tr></table></form></body></html>

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The difference between get and post two ways to submit

Related Article

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.