Should an edit of a comment be sent through POST or PUT?
Posted
by
the_drow
on Stack Overflow
See other posts from Stack Overflow
or by the_drow
Published on 2010-12-29T12:20:34Z
Indexed on
2010/12/29
12:54 UTC
Read the original article
Hit count: 138
I have the following URI: Posts/{postId}/Comments/{commentId}
I would like to enable users to edit a comment through my API, should the edit be done with POST or PUT?
One one hand, POST updates the contents of a resource so that makes sense but on the other hand PUT replaces it with a new one. So if I understand correctly with POST I need to send only what needs to be updates and with PUT I send the whole resource.
Usually in edit forms, the whole resource is loaded anyway so what's the point of using POST?
If I take one approach or the other, what are the differences?
© Stack Overflow or respective owner