5
Reply

What is the difference between PUT and POST request in REST APIs?

    PUT is idempotent means if you send n request to the server for for the same resource ,the resource will not be created instead will be updated. POST is not an idempotent means if you send n number of request to the server for the same resource n number of resource will be created Generally Put is used for update the resource and Post is used for create the resource

    PUT: Used to create a resource, or overwrite it. While you specify the resources new URL.POST: Used to modify and update a resource.

    PUT and POST both can be used for creating objects.PUT - Create or Update object i.e. its idempotent which means if you put an object twice it has no effect. POST - Create object i.e. it updates the data in resource and creates new instance.

    PUT is used to update (one or more fields - like SQL update how works)POST is used to insert a new record (like SQL INSERT)

    Put is use to update the resources and post is used to create resources.