DEV Community

Cover image for What Are Idempotent HTTP methods?
Andrew Savetchuk
Andrew Savetchuk

Posted on • Edited on • Originally published at blog.savetchuk.com

What Are Idempotent HTTP methods?

Idempotent HTTP methods​

An idempotent HTTP method is a method that can be called multiple times with the same input and produce the same result, without changing the state of the server.

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.


The end, I hope this information was helpful, stay tuned for more content :)

Top comments (0)