Muhammad Imran Ansari
What is the difference between PUT and POST in REST?

What is the difference between PUT and POST in REST?

By Muhammad Imran Ansari in .NET on Oct 02 2024
  • Ayush Gupta
    Oct, 2024 4

    PUT: Updates a resource at a specific URI. Idempotent—sending the same request multiple times results in the same outcome.eg-PUT api/users/123 {"name": "Jane Doe","email": "[email protected]" } here we are updating user with id =123.POST: Creates a new resource, usually without specifying the URI (the server decides). Non-idempotent—multiple requests can create multiple resources. eg-> POST api/users {"name": "Jane Doe","email": "[email protected]" } Here we will create a new user (resource ) in server and return the status 201.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS