Difference between idempotent and safe HTTP methods in REST APIs

pradeep m :

How could the PUT method be idempotent but not safe? Can someone explain it out?

HTTP Method   Idempotent      Safe
OPTIONS        yes            yes
GET            yes            yes
HEAD           yes            yes
PUT            yes            no
POST           no             no
DELETE         yes            no
PATCH          no             no
user7294900 :

Safe method doesn't change anything internally (resources)

Safe methods are methods that can be cached, prefetched without any repercussions to the resource.

Idempotent method doesn't change anything externally (response)

idempotent HTTP method is a HTTP method that can be called many times without different outcomes.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=123250&siteId=1