Solved

what is the advantage of doget?

Posted on 2002-06-25
7
648 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
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

770 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