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 |
What is the use of java servlet api?
Which httpsession object is used to view and manipulate information about a session?
Can we write a constructor for a Servlet class ? if yes how ? if no why not ?
Are Servlets by default thread safe or not? thanks in advance regards Sudhakar
Given the request path below, which are context path, servlet path and path info? /bookstore/education/index.html
waht is the main diference b/w servelts and JSP ?
what are the different services provided by the web server?
What are the key methods that are involved in processing of http servlets?
How do you configure a centralized error handler in servlets?
How do servlets work?
What compiler do not do if we create our own constructor?
When we don't write any constructor for the servlet, how does container create an instance of servlet?