[杂] get与post区别归纳

GET和POST都是HTTP协议的请求方法(request methods)。Wikipedia上对GET和POST的解释分别是:

The GET method requests a representation of the specified resource. Requests using GET should only retrieve data and should have no other effect. (This is also true of some other HTTP methods.)

大意是说GET method是一种只应该用来获取数据的手段 (should only retrieve data)。
所以说GET其实也是可以向服务器端发送信息的,但因为数据在URL里可见,并不推荐用GET发送信息。

The POST method requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. The data POSTed might be, for example, an annotation for existing resources; a message for a bulletin board, newsgroup, mailing list, or comment thread; a block of data that is the result of submitting a web form to a data-handling process; or an item to add to a database

大意是说POST method可以向服务器端发送信息。被POSTed的数据有可能是一条对已有资源的评论,论坛信息,表单数据或要添加到数据库的数据。

另外,GET的request可以被浏览器缓存(cached),发送的信息是有长度限制的,而POST不会被浏览器缓存,也没有长度限制。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值