I want to implement the partial updates for my resource as i have large resource and want to update the partial information from it.I have gone through the following links but not
able to figure out whether to use HTTP POST or PATCH methods.
How to submit RESTful partial updates?
http://jacobian.org/writing/rest-worst-practices/
https://github.com/archiloque/rest-client/issues/79
https://datatracker.ietf.org/doc/html/draft-dusseault-http-patch-16
http://greenbytes.de/tech/webdav/draft-dusseault-http-patch-06.html
http://jasonsirota.com/rest-partial-updates-use-post-put-or-patch
http://bitworking.org/news/296/How-To-Do-RESTful-Partial-Updates
https://github.com/dharmafly/jsonpatch.js
Please suggest any valid solution for this.
According to RFC5789 (https://www.rfc-editor.org/rfc/rfc5789), this is precisely what PATCH is for:
The distinction between PATCH and PUT is described as:
The limitations of POST are also described:
I would suggest you read the RFC and make up your own mind, but to me this seems fairly clear-cut – PATCH requests should be processed as partial updates. (NB they are NOT idempotent, unlike PUT.)
EDIT: as pointed out by Eugene in the comments, although PATCH requests are
"neither safe nor idempotent as defined by [RFC2616]", they can be made so: