Home > OS >  Is http put equivalent to delete and post?
Is http put equivalent to delete and post?

Time:12-18

I'm researching the difference between HTTP put and HTTP patch. As I understand it, the former replaces the entire resource (all fields must be supplied) whereas the latter only updates the resource (not all fields must be supplied). But what I'm wondering, and I can't seem to find an answer to this, is whether a put is equivalent to a delete and a post. In other words, would it receive a new database id, as would happen if one deleted the record and then posted a modified version of the record?

Thanks.

CodePudding user response:

For reference this question on Stackoverflow The difference between put post and patch.

As well as this post on Stackoverflow The difference between put and post

HTTP PUT is less of a HTTP DELETE & HTTP POST and more of a replace function. It needs an existing object in order to replace an object. HTTP PUT replaces an entire object. Unlike a HTTP PATCH which only replaces some of an object. HTTP POST creates a new object

  • Related