问题描述
我想知道这些servlet方法。我对这些方法有所了解,比如
I was wondering about these servlet methods. i know something about these methods like
-
doPost
对参数数字没有限制doGet
has。 -
doGet
快于doPost
。 -
doPost
比doGet
。
doPost
has no limitations on paramater numbers whiledoGet
has.doGet
is faster thandoPost
.doPost
is secured thandoGet
.
我的问题是,因为这些方法采用相同的参数并执行我们实施的流程。那么这些方法和之间的
。主要区别
是什么?这个方法的具体情况用于处理
And my question is, as these methods takes same parameters and does the process which we implement. then what is the major difference
between these methods and At which specific situation each of this method is used to process
.
推荐答案
你提到的技术差异很大,我们谈论的是REST metaphers。
There's the technically differences you mentioned and there's part where we're talking about REST metaphers.
除了POST和GET之外,还有PUT和DELETE。您应该将GET用于不改变数据的操作,POST用于创建,PUT用于更新数据。 DELETE显然是删除数据。
Beside POST and GET, there's PUT and DELETE too. You should use GET for operations which don't alter your data, POST for creation and PUT for update of data. DELETE is obviously for deletion of data.
这篇关于何时使用doGet,doPost和服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!