Solved

what is the advantage of doget?

Posted on 2002-06-25
7
626 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
Comment Utility
please give me some example also.
thanking you
madhu
0
 
LVL 9

Accepted Solution

by:
Venci75 earned 25 total points
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 9

Assisted Solution

by:Ovi
Ovi earned 25 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 video teaches viewers about errors in exception handling.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now