What is the difference between doGet and doPost?
Answers were Sorted based on User's Feedback
Answer / janet
1. doGet() method is used to get information ,while
doPost() method is used for posting information.
2.doGet() requests can't send large amount of information
and is limited to 24-255 characters.How ever doPost()
requests passes all of it's data ,of unlimited length.
3. A doGet() request is appended to the request URL in a
query string and this allows the exchange is visible to the
client,where as a doPost() request passes directly over the
socket connection as part of its HTTP Request body and the
exchange are invisible to the client.
Is This Answer Correct ? | 99 Yes | 22 No |
Answer / kalyan
1. In doGet() u submit the request by appending the URL
while in doPost() request is submitted via form.
2.Since doGet() appends the link it is not safe for request
containing passwords etc. while doPost() uses form hens it
is safe.
3.You can send only limited data in doGet() while unlimited
data in doPost() .
4.doGet() request could used like a bookmark as it uses URL
but doPost() can't be used as bookmark.
Is This Answer Correct ? | 22 Yes | 3 No |
Answer / ashish
they both r service methods.....
do get() has a disadvantage of sending very less amt of
information as it can send 24 to 255 character........
do post() is used for posting d information.....
Is This Answer Correct ? | 20 Yes | 5 No |
Answer / ram
do get() is used for passess the information limited amount
of data.
do post() is used for passess the information.and it send
unlimited data..it is providing more secure compare 2 do get
() method..
Is This Answer Correct ? | 29 Yes | 15 No |
Answer / ravi kumar
In doget() method there is a security problems are arrival
because when the user or client submit the form the
associated user name or password has been display on the
addressbar.
but in case of doPost() method when the user submit the
form the associated user name or password are not display
on the addressbar.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / shivani
doGet is used when there is are requirement of sending data appended to a query string in the URL. The doGet models the GET method of Http and it is used to retrieve the info on the client from some server as a request to it. The doGet cannot be used to send too much info appended as a query stream. GET puts the form values into the URL string. GET is limited to about 256 characters (usually a browser limitation) and creates really ugly URLs.
doPost allows you to have extremely dense forms and pass that to the server without clutter or limitation in size. e.g. you obviously can't send a file from the client to the server via doGet. doPost has no limit on the amount of data you can send and because the data does not show up on the URL you can send passwords. But this does not mean that POST is truly secure. It is more secure in comparison to doGet method.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / benjamin
thank all for your answers:
doGet simply request a ressource from server(e.g pages) by
opposite of doPost which can request a ressource and post
form data to a server
Is This Answer Correct ? | 4 Yes | 6 No |
Differentiate between the get and post method
What are the mechanisms used by a servlet container for maintaining session information?
How do servlets work?
What are the life cycle methods of the servlet?
How can we invoke another servlet in a different application?
How to generate the server side programming and the advantages of it over the other languages?
What is the dispatcher servlet?
Can a servlet be called by passing its name as a parameter in the URL?
What is the functionality of actionservlet and requestprocessor?
How can we implement a jsp page?
Explain the steps involved in placing a servlet within a package?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?