java - REST API 中幂等和安全 HTTP 方法之间的区别

标签 java rest http http-method idempotent

PUT方法怎么能做到幂等而不安全呢?谁能解释一下?

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

最佳答案

Safe method 内部(资源)没有任何改变

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

Idempotent method不会外部改变任何东西(响应)

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

关于java - REST API 中幂等和安全 HTTP 方法之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56729786/

相关文章:

Java Enum 构造函数是私有(private)的吗?

java - 无法使用 Postman : USER_REQUIRED error 在 reddit 上发表评论

javascript - 使用纯 JS 的 REST API 微调器

java - 解析 RESTful PUT

http - 什么是正确的 HTTP 重定向状态代码?

python - HTTP 请求为 params 中的一个键分配多个值

java - 从头开始实现ADT链表

java - 为什么我们不能增加 asList() 返回的 ArrayList 对象的大小?

java - 如何快速得到搜索结果?

amazon-web-services - 作为客户端应用程序,我如何获取从 Amazon 负载均衡器 (ALB) 转发给我的 'x-amzn-oidc-*' header ?