• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

POST and GET Method Diferences

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello every one,
I was finding diferences between GET and POST method attribute of <form> tag in HTML. I am very much clear with the following differences:

GET:
1. The web browser submits the form data as part of a URL.
2. We can pass limited data.
3. In GET URL is visible.
POST:
1. The web browser sends the form's data separetly from the URL as a stream of bits.
2. Therefor, POST method can handle any amout of data.
3. Data send by POST method is not visible in the URL.
I found some other differences (read from forum and books ) but could not understand what they mean. Can any one explain me clearly in detail what it mean.
GET:
1. URL can be bookmarked. what dose it mean?
2. The GET method should be safe, that is, without any side effects for which users are held responsible.
3. If a client request is intended to change stored data, the
request should use some other HTTP method.
4. The GET method should also be idempotent, meaning that it
can be safely repeated. What dose it mean and how dose it work? Any example, pls?
POST:
1. This method does not need to be either safe or idempotent.
2. Operations requested through POST can have side effects for
which the user can be held accountable.
Pls explain me what dose the above sentance mean with example.

Thanks.
Raj.

------------------
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My way of understanding things are like this:
GET:
1. URL can be bookmarked. what dose it mean?

One user logs in (so registered and authorised), gets some data. If the queries/updates can be passed in URL, then this URL can
be bookmarked and used by any unauthorised person to get access
to the data, which defeats the purpose.
2. The GET method should be safe, that is, without any side effects for which users are held responsible.
i would not perform any updates or things like that where
there is a likelyhood of data corruption.
3. If a client request is intended to change stored data, the request should use some other HTTP method.
Should use POST method. Modification of data is not to be
allowed thur the GET method, since it has to be safe.
4. The GET method should also be idempotent, meaning that it can be safely repeated. What dose it mean and how dose it work? Any examples pl.
say something like a login. Users should be able to login any
number of times they want. Doesn't necessarily mean login two
times at the same time.

POST:
1. This method does not need to be either safe or idempotent.

This sentence simply complements the next sentence. Pl. read the
expln. below.
2. Operations requested through POST can have side effects for which the user can be held accountable.
Data modification should be performed with these methods.
Any updates etc. An example would be Change Passwd.
So we take the input new passwd, do the validity checks (sample):
passwd should be 8 chars or more
no special chars.
cannot be consecutive numbers...
yada yada yada....

So if any of these rules are voilated, then we know its a user
error. Otherwise, we could go ahead and update the user profile
with the new passwd.
Though practically, these two methods can be used
interchangeably, the API suggests that we follow these
guidelines.
Hope this helps.
Regds.
- satya
 
reply
    Bookmark Topic Watch Topic
  • New Topic