PUT methods are used to request the server to store the enclosed entity in request. In case, the request does not exist, then new resource has to be created. If the resource exists, then the resource should get updated.
POST method is used to request the server to store the enclosed entity in the request as a new resource.
The URI should have a resource identifier. Example:
The POST URI should indicate the collection of the resource. Example:
PUT methods are idempotent.
POST methods are not idempotent.
PUT is used when the client wants to modify a single resource that is part of the collection. If a part of the resource has to be updated, then PATCH needs to be used.
POST methods are used to add a new resource to the collection.
The responses are not cached here despite the idempotency.
Responses are not cacheable unless the response explicitly specifies Cache-Control fields in the header.
In general, PUT is used for UPDATE operations.
POST is used for CREATE operations.