The HTTP protocol defines two methods for updating a resource – PUT
and
POST
. Both PUT
and POST
are used to modify a resource and this semantic
similarity can confuse API developers. This confusion has led most developers to
use POST
for any action which may modify the state of a resource, ignoring
PUT
entirely.
This article attempts to explain the semantics behind the PUT
and POST
methods and offers clear suggestions on when to use each method.