Really the only difference is symantics. According to Http RFC's the GET method is supposed to indicate a request for resource (i.e., HTML page, document, etc) whereas POST is supposed to indicate a request which will modify data on the server. In practice, POST is usually used in "posting" form data, etc.
That being said, there is really no difference between the two. In fact servlets usually implement these as follows:
public class MyServlet extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
doGet(req, res);
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
// Processing code...
}
Hi
Differences are:
1) limited data can be sent thru(about 1kb) GET method
whereas unlimited data can be sent thru POST method.
2) Form field values are concatenated to the URL
( http://www.xyz.com?name1=value1&name2=value2.. ) in case of GET i.e form fields values will be visible in URL which is very dangerous in case of if u send username and password using GET method whereas values are directly posted thru POST and values will be visible
3) GET will be useful in case of URL in hyperlinks and u
want to send some parameters to the Servlet. Sending
parameters to servlet thru hyperlinks is by default sent
using GET method. for eg:
<a href="http://www.xyz.com/ExampleServlet?name1=value1&name2=value2...>ExampleServlet</a>
Vinay
">