PUT POST being idempotent (REST)

前端 未结 3 813
执念已碎
执念已碎 2020-12-31 15:07

I don\'t quite get how the HTTP verbs are defined as idempotent. All I\'ve read is GET and PUT is idempotent. POST is not idempotent. But you could create a REST API using P

3条回答
  •  时光说笑
    2020-12-31 15:26

    hope the link helps to you:HTTP Method idempotency

    Be careful when dealing with safe methods as well: if a seemingly safe method like GET will change a resource, it might be possible that any middleware client proxy systems between you and the server, will cache this response. Another client who wants to change this resource through the same URL(like: http://example.org/api/article/1234/delete), will not call the server, but return the information directly from the cache. Non-safe (and non-idempotent) methods will never be cached by any middleware proxies.

提交回复
热议问题