What's the justification behind disallowing partial PUT?

后端 未结 4 1250
一生所求
一生所求 2020-12-08 22:10

Why does an HTTP PUT request have to contain a representation of a \'whole\' state and can\'t just be a partial?

I understand that this is the existing definition of

4条回答
  •  借酒劲吻你
    2020-12-08 22:40

    Because, I guess, this would have translated in inconsistent "views" when multiple concurrent clients access the state. There isn't a "partial document" semantics in REST as far as I can tell and probably the benefits of adding this in face of the complexity of dealing with that semantics in the context of concurrency wasn't worth the effort.

    If the document is big, there is nothing preventing you from building multiple independent documents and have an overarching document that ties them together. Furthermore, once all the bits and pieces are collected, a new document can be collated on the server I guess.

    So, considering one can "workaround" this "limitations", I can understand why this feature didn't make the cut.

提交回复
热议问题