根据 WebDAV 规范(RFC 4918):
The semantics of GET are unchanged when applied to a collection, since GET is defined as, "retrieve whatever information (in the form of an entity) is identified by the Request-URI" [RFC2616].
和PROPFIND
retrieves properties defined on the resource identified by the Request-URI.
因此 GET 和 PROPFIND 或多或少地检索了资源的信息。从这个意义上讲,GET 和 PROPFIND 之间是否有任何重大区别以及何时应该使用一个而不是另一个。
最佳答案
你所指的那段话解释了它:
GET, when applied to a collection, may return the contents of an "index.html" resource, a human-readable view of the contents of the collection, or something else altogether.
即GET
的行为与过去一样,以保持向后兼容性。它通常会返回一个“索引”页面(文件 index.html
、index.php
或类似文件)或者它会自动呈现一个包含目录内容的 HTML 页面(一个文件列表)。这意味着 WebDAV 服务器可以在与 HTTP 服务器相同的端口上运行(= 作为 HTTP 服务器的扩展),现有 HTTP 请求的行为相同。
虽然根据 WebDAV 规范,WebDAV PROPFIND
请求将返回一个精确定义的、机器可读的 XML 文档。
如果您正在实现 WebDAV 客户端或服务器,您只对 PROPFIND
感兴趣。 GET
响应没有定义的格式(甚至没有内容),因此应用程序无法解析它。
关于http - WebDAV 中 GET 和 PROPFIND 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33608022/