HTTP PUT sends a replacement representation for an existing resource. In an ASP.NET Core products API, an action restricted to PUT receives a Product from the request body through model binding and updates the database. section 19.4.2
Listing 19.12 Updating an object
Invoke-RestMethod http://localhost:5000/api/products -Method PUT -Body (@{
ProductId=1; Name="Green Kayak"; Price=275; CategoryId=1; SupplierId=1} |
ConvertTo-Json) -ContentType "application/json"
The PowerShell request sends JSON to /api/products with ProductId=1 and replacement property values. Requesting the products collection afterward lets you check the change. section 19.4.2







