POST can send user data
--get是一个简单的请求
--post 能够发送用户的数据
GET is the simplest HTTP method, and itsmain job in life is to ask the server to get a
resource and send it back. That resource might
be an HTML page, a JPEG, a PDF, etc. Doesn’t
matter. The point of GET is to get something
back from the server.
--get是最简单的http方法。它的生命周期中做的事情主要是向服务器请求资源然后返回。
---请求的资源有先限制:不能是HTML页面,jpeg,pdf等格式。
POST is a more powerful request. It’s like aGET plus plus. With POST, you can request
something and at the same time send form data
to the server
--使用post可以在向服务器请求资源的同时,向服务器发送表单数据
Reasons you might use POST instead of GET include:
1、The total amount of characters in a GET is really limited (depending
on the server). If the user types, say, a long passage into a “search”
input box, the GET might not work
---字符个数的限制(取决于服务器)
2、The data you send with the GET is appended to the URL up in
the browser bar, so whatever you send is exposed. Better not put a
password or some other sensitive data as part of a GET!
---发送的信息会显示在url上
3、Because of number two above, the user can’t
bookmark a form submission if you use POST
instead of GET. Depending on your app, you may
or may not want users to be able to bookmark the
resulting request from a form submission.