Solved

what is the advantage of doget?

Posted on 2002-06-25
7
667 Views
Last Modified: 2012-05-04
What is the advantage of doget over dopost?
if dopost is superior then why should use doget? wha is the advantage of doget over do post?
0
Comment
Question by:anmadhu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:anmadhu
ID: 7106687
please give me some example also.
thanking you
madhu
0
 
LVL 9

Accepted Solution

by:
Venci75 earned 25 total points
ID: 7106708
Because there is a limitation in the length of the URL in the http request. In get method the parameters are passed in the URL:

GET /servlet/myServlet?param1=value1&param2=value2&...

when you use post method you send the parameters in the body of the http request:

POST /servlet/myServlet
content-length: ???
content-type: application/x-www-form-urlencoded

param1=value1&param2=value2&...

as you can see - there is no such limitation for the body. You just need to specify the correct content-length.

As you can see - the doPost() is better because of the specifics of the HTTP protocol!
0
 
LVL 2

Assisted Solution

by:willstones
willstones earned 25 total points
ID: 7106994
The only real advantage of using GET (as far as I can see) is that a person could copy the url, or add it to their favorites and get back to it again.  Whereas if POST is used then they would have to fill in all of the form data again to get back to that page.

On another point, POST is more secure, well not more secure to hackers, but if someone is looking over your shoulder and you have the url:
  http://www.somepage.com?myPassword=mypassword
in your browser then thats a bit easy for them, also this would be stored in the browser cache and all over the place.  Whereas if POST is used then it gets sent directly to the server and stored no where.  Other than that the only difference is as Venci75 said, content length.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 9

Assisted Solution

by:Ovi
Ovi earned 25 total points
ID: 7107151
Normally there should not be terms of comparisation between http GET and POST methods. Why, because the first one is used for geting something from a server, while the other one for sending something to the server.

On the other hand, of course, you can behave in server side for a POST request like for a GET, by sending the real data on the response output stream, but you should be aware that this is not the default implementation used accross the web. On a post methos also (I believe someone allready said this) you must provide a content and costomize the URLConnection to server to perform'it.

About sequrity issues, there is no difference between GET and POST. If the sserver is password protected you must perform authentication for both methods.


So in a word on the server side there is no difference; on the client side the only difference is that you must change the connection parameters since the default method is GET.

I suggest you to use the normal way, GET for read, POST for write.
0
 
LVL 16

Assisted Solution

by:heyhey_
heyhey_ earned 25 total points
ID: 7109862
another difference is that proxies usually log all URLs and that includes all GET parameters. so all the data that you send will be available for anyone that has access to proxy logs.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8860691
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this
question is:

- split points among Venci75, willstones, Ovi and heyhey_

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mysql jsp example issue 32 74
Why is enum singleton a better approach than static factory 3 52
wild fly 8 startup error 2 42
Netbeans and org.apache.commons.lang3 issue 3 27
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question