I have been reading up on the difference between put and post requests and I have some related questions as it pertains to rails: I would like to change one specific field i
There is lot of confusion around PATCH as well, I personally agree how JSON API standard is proposing to do it http://jsonapi.org/format/#crud-updating:
PATCH /articles/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "articles",
"id": "1",
"attributes": {
"title": "To TDD or Not"
}
}
}
I love Rails I but truth is it's not entirely following some core Web conventions. Rails is trying to be productive and too strict conventions are holding down the productivity. So don't go overboard when seeking answer for this. Truth is that Rails is treating PUT and PATCH the same way, and apparently both are wrong. So I recommend:
But if your entire project is using PUT everywhere, you don't need to go through and change everything. Just stick to one or the other (PUT or the PATCH).
UPDATE
I've wrote 2 articles on this topic where I go in depth of this topic.