Andrew Savetchuk
Andrew Savetchuk's Blog

Andrew Savetchuk's Blog

What are Idempotent HTTP methods?

What are Idempotent HTTP methods?

Andrew Savetchuk's photo
Andrew Savetchuk
·Apr 25, 2022·

1 min read

Idempotent HTTP methods​

An idempotent HTTP method is a method that can be invoked many times without different outcomes. It does not matter whether the method was called only once or five times. The result should always be the same. Idempotency essentially means that the result of a successfully performed request does not depend on the amount of its execution. For example, in arithmetic, adding zero to a number is an idempotent operation.

Why do we need Idempotency?​

API consumers can make mistakes and write the client code in such a way that there can be duplicate requests coming to the API. Idempotency is needed to make APIs fault-tolerant so that duplicated requests do not leave the system unstable.

 
Share this