PUT is used by FB to update the comment because an existing resource is being updated, and that is what PUT does (updates a resource). PUT happens to be idempotent, in contrast to POST.
The difference between POST and PUT is that PUT is idempotent, that means, calling the same PUT request multiple times will always produce the same result (that is no side effect), while on the other hand, calling a POST request repeatedly may have (additional) side effects of creating the same resource multiple times.
I'm building a RESTful API using Zend Framework via the Zend_Rest_Route. For uploading of files, should I use PUT or POST to handle the process? I'm trying to be as consistent as possible with the
I have few questions that: Although, it a restful api but specific application which would be used by an angular application, So should I return data in response of POST/PUT requests. Should I use PATCH in case of Verify (or anyother action where just recordId and versionNo send to server to change some fields) or it is OK to use PUT.
PUT and PATCH methods are similar in nature, but there is a key difference. PUT - in PUT request, the enclosed entity would be considered as the modified version of a resource which residing on server and it would be replaced by this modified entity.
Since PUT requests include the entire entity, if you issue the same request repeatedly, it should always have the same outcome (the data you sent is now the entire data of the entity). Therefore PUT is idempotent. Using PUT wrong What happens if you use the above PATCH data in a PUT request?