Monday, July 16, 2012

doGet() and doPost()


DoGet

DoPost

In doGet Method the parameters are appended to the URL and sent along with header information

In doPost, parameters are sent in separate line in the body

Maximum size of data that can be sent using doget is 240 bytes

There is no maximum size for data

Parameters are not encrypted

Parameters are encrypted

DoGet method generally is used to query or to get some information from the server

Dopost is generally used to update or post some information to the server

DoGet is faster if we set the response content length since the same connection is used. Thus increasing the performance

DoPost is slower compared to doGet since doPost does not write the content length

DoGet should be idempotent. i.e. doget should be able to be repeated safely many times

This method does not need to be idempotent. Operations requested through POST can have side effects for which the user can be held accountable, for example, updating stored data or buying items online.

DoGet should be safe without any side effects for which user is held responsible

This method does not need to be either s

No comments:

Post a Comment