When designing a REST API, which HTTP method would you choose to ensure idempotence for updating existing resources?

  • DELETE
  • PATCH
  • POST
  • PUT
The PUT method should be chosen to ensure idempotence for updating existing resources in a REST API. PUT is used to update or create a resource at a specific URI, and sending the same request multiple times has the same effect as sending it once. PATCH is used for partial updates, POST for creating resources, and DELETE for deleting resources.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *