?
Solved

what is the advantage of doget?

Posted on 2002-06-25
7
Medium Priority
?
681 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 100 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 100 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Assisted Solution

by:Ovi
Ovi earned 100 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 100 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 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