4 ms·
It seems like PATCH could be implemented as a PUT to a resource that represents the transformation of some other complete resource, allowing you to just PUT the
by jcapote 17y ago
It seems like PATCH could be implemented as a PUT to a resource that represents the transformation of some other complete resource, allowing you to just PUT the changes as opposed to the whole document.
- sophacles 17y agoThat seems to break the REST metaphor of nouns and verbs, at least it strains it. I mean sure, a noun of "transmogrifier" is fine, and if you put something in there, it can be reasonably expected to undergo transmogrification. However, just allowing a "change it" verb on a resource seems a bit more direct.
- psadauskas 17y agoA PUT is already well-defined, and more importantly, idempotent. Adding PATCH-like behavior would not be repeatable, and would break every HTTP server, client, and proxy out there.
- jluxenberg 17y agoPATCH, like PUT, can be used in an idempotent manner using the "If-Matches" header. If the content being PATCHed matches a given ETag, then the path will be applied, otherwise the path will not be applied and a 412 Precondition Failed should be returned.