http - WebDAV 中 GET 和 PROPFIND 的区别

标签 http webdav

根据 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.htmlindex.php 或类似文件)或者它会自动呈现一个包含目录内容的 HTML 页面(一个文件列表)。这意味着 WebDAV 服务器可以在与 HTTP 服务器相同的端口上运行(= 作为 HTTP 服务器的扩展),现有 HTTP 请求的行为相同。

虽然根据 WebDAV 规范,WebDAV PROPFIND 请求将返回一个精确定义的、机器可读的 XML 文档。


如果您正在实现 WebDAV 客户端或服务器,您只对 PROPFIND 感兴趣。 GET 响应没有定义的格式(甚至没有内容),因此应用程序无法解析它。

关于http - WebDAV 中 GET 和 PROPFIND 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33608022/

相关文章:

javascript - 如何在页面加载开始时启动多个 http 请求?

java - 多部分表单数据中文件名中的国际字符

c# - 405 方法不允许 Web API

sharepoint - 用于第 3 方连接的 onedrive 的 WebDav URL

java - Jackrabbit WebDAV 同步示例?

.net - 使用 WebClient 的 HTTP 2 协议(protocol)

c# - 如何在我的 C# 类中运行 jQuery?

linux - 为什么最后一段 HTTP 下载真的很慢?

apache - 无法通过 WebDAV 移动或重命名文件