• 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

Doubi in Head First Servlet n JSP book page 114

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The HTTP 1.1 spec declares GET,HEAD, and PUT as indempotent even though you can write a non indempotent doGet() method yourself(but shouldn't).
POST is considerd indempotent by the HTTP 1.1 spec.

what does it mean ? isn't it saying that all above mentioned HTTP methods are indempoent?
 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

As mentioned in the HFSJ book, an idempotent method is the one without any negative consequences on the server side.

From the statement above, GET only gets something from the server back to you.

But with post, you may have to save the data of a web-form on the database, so this will cause side effects (talking to your MySQL server as an example).

So POST is not idempotent.

There's a great statement in the HFSJ book which says : " Being idempotent is good. It means you can do the same thing over and over again, with no unwanted side effects! "

Think about it for a while, with GET you can get a specific resource thousands of times without any editions on the server side.

For sure you can make a GET to act as a not idempotent, but, following the rules and the spec will make you feel better ...

Best regards ...
reply
    Bookmark Topic Watch Topic
  • New Topic