HTTP 中get 和post的区别

GET is a simple request, 

POST can send user data

--get是一个简单的请求

--post 能够发送用户的数据

GET is the simplest HTTP method, and its 
main 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 a 
GET 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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值