by Dinesh Thakur Category: introduction to Servlet

In doGet Method the parameters are appended to the URL and sent along with the information. Maximum size of data that can be sent using do Get it 240 bytes. Parameters are not encrypted. doGet method generally is used to query or to get some informationfromthe server.

doGet is faster if we set the response content length since the same connection is used. Thus increasing the performance. doGet should be important. doGet should be able to be repeated safely many times. doGet should be safe without any side effects for which user is held responsible.

doPost

In doPost, parameters are sent in separate line in the body. There is no maximum size for data. Parameters are encrypted. doPost is generally used to update or posts some information to the server. do Post is slower compared to doGet since do Post does not write the content length.

This method does not need to be important 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.



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.