HTTP Methods and idempotentency

  • Indempotent Methods – Are those methods which cannot be called repeatedly since they create multiple entries in Database which may cause inconsistencty
  • Safe Methods – Are those methods which is only a ready only operatoin

According to HTTP specification, Indempotent methods should be safe for the client to be called multiple times without worrying or creating multiple entries

So this is the reason PUT (update) request is Idempotent and POST request is non-idempotent, PUT request can be called multiple times without affecting the response while POST cannot do the same

Hence idempotent methods are cache by a web server if called multiple times in a consecutive batch

Browser safe guard the repeated call of post request on a browser refresh. i.e it shows “Do you really want to resubmit the form” because it a non-idempotent request

  • Get – Read Data
  • Post – Create Data
  • Put – Update Data
  • Delete – Delete Data
  • Options – Check what are HTTP methods are allowed by a server we check using OPTIONS
  • Head – Like Get but only returns Header Info and Http Status, no payload in returned
  • Patch – Like PUT but cannot be re-called since the status is changed now in DB (Non Idempotent)

Reference :

Leave a Comment