Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get and Post Method

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Help me out. What is the basic difference between Get and Post method apart from following two :
(1) In Get method, we can attach Query String and URL can be bookmarked. Here, we can pass limited data.
(2) In the Post method, we can pass any amount of Data.
I was asked to tell five difference apart from these two.
Thanks.
Rakesh
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are some
1. GET method retrieve data by SQL queries POST to update data.
2. POST you can use Streams.
3. GET restricts based on URL length wheras these are not there in POST.
4. In POST data is hidden from user whereas in GET the URL is visible.
These are some that i know. Hope i am able to add to knowledge.
Bye
SimpleSteps
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear SimpleSteps
Whatever we use GET method, It limits the URL length and In the Post, We can send any amount of data. So, I think, third and fourth point given by you is ok short of. Any way thanks for that.
Rakesh
 
Naveen Chandra
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
By the way what is the maximum length of the URL that one
can generate and send across the web.
Thanks in advance,
Naveen.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMHO About 250 characters
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

IMO, (one of my friends said this, really)
the limitation on URL is 1 kb (whatever that means).
regds.
- satya
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hmmm.....5 differences....here goes my attempt
doPost:

  • Called by the server (via the service method) to allow a servlet to handle a POST request.
  • POST method allows the client to send data of unlimited length to the Web server a single time
  • useful when posting secure data (like credit card numbers)
  • This method does not need to be either safe or idempotent.
  • Operations requested through POST can have side effects for
    which the user can be held accountable, for example, updating
    stored data or buying items online.

  • doGet:

    • Called by the server (via the service method) to allow a
      servlet to handle a GET request.
    • Overriding this method to support a GET request also
      automatically supports an HTTP HEAD request.
    • The GET method should be safe, that is, without any side effects for which users are held responsible.For example, most form queries have no side effects.
    • If a client request is intended to change stored data, the
      request should use some other HTTP method.
    • The GET method should also be idempotent, meaning that it
      can be safely repeated.

    • so did you get the arithemetic right....
      I am not an expert in Servlets but definetly know where to look... ...
      You can find all this and much more at the J2EE API Specs
      enjoy.....
      Regds.
      - satya
 
Arathi Raj
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Operations requested through POST can have side effects for
which the user can be held accountable, for example, updating
stored data or buying items online.

Can anyone explain me this in detail. How Post will have side effects. when sendind date through this method is safe?

Also I want to know

GET method retrieve data by SQL queries POST to update data.
What does these mean. Explain this also.

Thanks
arathi
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply, but this thread was 5 years old, there is no benefit in resurrecting it.

If you would like to ask a new question it is better to start a new thread, referring to another if desired.

Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I see you did that too. Please don't do that
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic