I was wondering when to use doGet() and doPost() methods? I hear doGet() is used to get information from the client/browser and doPost() is used to send information back to the broswer? is it true? if so, can someone please give me an example as where to use doGet() and where to use doPost() methods instead of just the definitions?
Just to add to Raghavan's, the "GET" action is used generally to retrieve the data from a server machine. Although "POST" can accomplish the above the task, it is more often used to post details to a server.. ie updating the database of the server. Since the information being posted by a client is generally confidential,the parameters posted from the form are made invisible in the address bar.
Just to add to Raghavan's, the "GET" action is used generally to retrieve the data from a server machine.
Is it right? And both methods were used to post the values to the server with the difference that Raghavan explained there. So if you need to pass some confidential and huge amount of data then opt for POST method. Otherwise go for GET method. Am i right Raghavan?
Never try to be a hard-worker. Be a smart-worker.
Phani is right but intern he meant to say the idempotent requests.
It is basically the values you sent to server can be used to just retrieve the values OR to update! In the database (SQL) perspective, it can be told as Select Vs Update! From the client side the values are just sent, but what those values are used for at the server side does matter!