Idempotent methods
An idempotent HTTP method is method that can be called many times without different outcomes. It has no additional effect if it is called more than once with the same input parameters, the result would be the same.
Consider the following examples:
a = 1;//Line 1 (Idempotent)
a++; //Line 2 (Not Idempotent)
The Line 1 is idempotent because no matter how many times we execute this
statement, a will always be 1.
The Line 2 is not idempotent because executing this everytimes will result in a
different outcome.
Overview of HTTP methods
Note:-
- An operation is called idempotent if it will produce the same results when executed once or multiple times.
POST
is NOT idempotent and remaining http method(GET
,PUT
,DELETE
,HEAD
,OPTIONS
andTRACE
) are idempotent.
[…] What is idempotent method. […]
LikeLike