Skip to Content
Building RESTful Web Services with .NET Core
book

Building RESTful Web Services with .NET Core

by Gaurav Aroraa, Tadit Dash
May 2018
Intermediate to advanced
334 pages
7h 25m
English
Packt Publishing
Content preview from Building RESTful Web Services with .NET Core

POST versus PUT explained

The use of POST and PUT can be summarized in the following two points:

  • PUT is idempotent—it can be repeated, and yields the same result every time. If the resource does not exist, it will create it; otherwise, it will update it.
  • POST is nonidempotent—multiple resources will be created if it is called more than once.

The preceding contrast between these verbs is just a general difference. However, there is a very important and significant difference. When using PUT, specifying the complete URI of the resource is necessary. Otherwise, it won't work. For example, the following won't work as it does not specify the exact URI of the author, which can be done by specifying an ID:

PUT http://packtservice.com/Authors/ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RESTful Web Services with ASP.NET Core 3

Hands-On RESTful Web Services with ASP.NET Core 3

Samuele Resca
Microservices in .NET Core

Microservices in .NET Core

Christian Horsdal Gammelgaard

Publisher Resources

ISBN: 9781788291576Supplemental Content