What is the difference between Get and Post Method?
Answers were Sorted based on User's Feedback
Answer / manu
in Get method,data is passed in urlpattern i.e can be seen
everyone
in post method data is passed with in method body.
Is This Answer Correct ? | 35 Yes | 5 No |
Answer / raghunath bj
Get and Post will do the same kind of operation which takes
requests from the browser but the key difference between
them is Get can not contain large number of data but post
can have large number of data to post the request.
Is This Answer Correct ? | 18 Yes | 1 No |
Answer / jitendra
The key difference between Get and post is:
1) By using post method we can send large date as compare to
Get.
2) Post is more secure then Get because in case of Get
method, the data is visible in the URL of the browser and
can be directly accessed.
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / alok kumar ranjan
Re: What is the difference between Get and Post Method?
Answer: (1). Get is Default Http Method, but in post method
you should specify the post method implicitely as follows:-
<form action=" " method="post"
(2) In Get Method,data is pssed in URL Pattern. But in post
method data is passed with in method body.
(3) In Get Method,Size of URL is limited because of this e
can send only limited amount of data to server using the
get method. But in Post Method,We can send the data
unlimited amount of the data.
(4) Get Method is not secured because data can be seen in
URL. But Post Method is very Secured.
(5) Through Get Method,We can not send data to server But
In POst Method,We send the data to server
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / amitasite
I would like to add more to Jitendra's answer
3) Get is idempotent while post is not
4) you can send binary data using post
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sandeep singh
In Get can't be more than 255 characters long
In Post enter more than 255 characters long
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / meera
Difference between GET and POST methods
•Fundamental Difference is probably the Visibility - GET
request is sent via the URL string (appended to the URI
with a question-mark as separator), which is visible
whereas POST request is encapsulated in the body of the
HTTP request and can't be seen.
•Length - Since, GET request goes via URL, so it has a
limitation for its length. It can't be more than 255
characters long (though this is browser dependent, but
usually the max is 255 characters only). Whereas no such
maximum length limitation holds for the POST request for
the obvious reason that it becomes a part of the body of
the HTTP request and there is no size limitation for the
body of an HTTP request/response.
•Performance - GET request is comparatively faster as it's
relatively simpler to create a GET request and the time
spent in the encapsulation of the POST request in the HTTP
body is saved in this case. In addition, the maximum length
restriction facilitates better optimization of GET
implementation.
•Type of Data - GET request is sent via URL string and as
we all know that URL can be text-only, so GET can carry
only text data whereas POST has no such restriction and it
can carry both text as well as binary data.
•Caching/Bookmarking - again for the obvious reason that a
GET request is nothing but an URL hence it can be cached as
well as Bookmarked. No such luxuries with a POST request.
•FORM Default - GET is the default method of the HTML FORM
element. To submit a FORM using POST method, we need to
specify the method attribute and give it the value "POST".
•Data Set - GET requests are restricted to use ASCII
characters only whereas POST requests can use the 'enctype'
attribute with a value "multipart/form-data" to use the
Universal Multiple-Octet Coded Character Set (UCS).
Is This Answer Correct ? | 1 Yes | 0 No |
I would like to add more to Jitendra and Amitasite's answer
5)By using GET,hidden variables are also shown as a part of URL,But By POST,hidden variables are hidden.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / ravikiran.chd
Get is used to get the resouces from the server
post is the one which will post the content in the body of
the request
Is This Answer Correct ? | 3 Yes | 6 No |
request parameter how to find whether a parameter exists in the request object?
What are the exceptions thrown by servlets? Why?
Given the request path below, which are context path, servlet path and path info?
What is the major difference between context parameter and context attribute?
When Servlet is unloaded?
What do you mean by filter in servlet?
Explain url encoding?
Is classes folder is compulsory in web-inf/ even though u r deploying ur application with war file?
what is servlet chaining?
what is the difference between?when we write the code in following manner? class One extends httpservlet { } and class One extends genericservlet { }
How do servlets work?
What is difference between Forward() and sendRedirect() methode?