4 ms·
Wouldn't it be easier to use a PUT with a Transfer-Encoding of "text/x-diff" (or some such) and an If-Match header?
by m_eiman 17y ago
Wouldn't it be easier to use a PUT with a Transfer-Encoding of "text/x-diff" (or some such) and an If-Match header?
- blasdel 17y agoNo, because PUT is defined as something entirely different — multiple identical PUT requests on the same resource at different times should always transfer the same state and have the same response. PUT is also defined such that the body contains the whole resource, ideally in a Content-Encoding that you can GET with an appropriate Accept header.
- m_eiman 17y agoMultiple identical PUT requests with Transfer-Encoding:diff+If-Match will result in the same thing as a "normal" PUT with an If-Match header - if the resource is in the matched state it will be transformed, and if it isn't it will be unchanged. The Transfer-Encoding:diff+If-Match combo is in effect the same thing as sending the whole data blob, it's just an efficient transfer compression. No different than Transfer-Encoding:gzip; the data sent isn't the data to be stored until its Transfer-Encoding has been reversed.