Should an edit of a comment be sent through POST or PUT?
- by the_drow
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?