WebDAV的最小请求响应周期示例? [英] Example of a minimal request response cycle for WebDAV?

查看:112
本文介绍了WebDAV的最小请求响应周期示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在标题和正文的典型请求 - 响应周期的最小(可能是注释)示例。据我了解,这包括一个初始的OPTIONS和一个后续的PROPFIND交换 - 之后,GET和PUT应该是直截了当的,所以我不需要那里的通用示例。

Is there a minimal (possibly annotated) example of a typical request-response cycle, with both headers and body. As I understand it, this consists of an initial OPTIONS and a subsequent PROPFIND exchange - after that, GET and PUT should be straightforward, so I don't need a generic example there.

我一直在考虑通过WebDAV公开现有的RESTful资源(集合和单个项目)。我只需要基本的功能 - 列出目录,读取和写入文件 - 其中AFAICT意味着添加PROPFIND支持就足够了。

I've been considering exposing existing RESTful resources (collections and individual items within) via WebDAV. I only need basic functionality to work - listing directories, reading and writing files - which AFAICT means adding PROPFIND support should suffice.

推荐答案

该规范包含示例:

请求:

OPTIONS /somecollection/ HTTP/1.1
Host: example.org

回复:

HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, ORDERPATCH
DAV: 1, 2, ordered-collections



< h2>现实

请求:

Realistic

Request:

  PROPFIND /somecollection HTTP/1.1
    Depth: 0
    Content-Type: text/xml; charset="utf-8"
    Content-Length: xxx

    <?xml version="1.0" encoding="UTF-8" ?>
    <propfind xmlns="DAV:">
      <prop>
        <supported-live-property-set/>
        <supported-method-set/>
      </prop>
    </propfind>

回复:

HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
  <response>
    <href>http://example.org/somecollection</href>
    <propstat>
      <prop>
        <supported-live-property-set>
          <supported-live-property>
            <prop><ordering-type/></prop>
          </supported-live-property>
          <!-- ... other live properties omitted for brevity ... -->
        </supported-live-property-set>
        <supported-method-set>
          <supported-method name="COPY" />
          <supported-method name="DELETE" />
          <supported-method name="GET" />
          <supported-method name="HEAD" />
          <supported-method name="LOCK" />
          <supported-method name="MKCOL" />
          <supported-method name="MOVE" />
          <supported-method name="OPTIONS" />
          <supported-method name="ORDERPATCH" />
          <supported-method name="POST" />
          <supported-method name="PROPFIND" />
          <supported-method name="PROPPATCH" />
          <supported-method name="PUT" />
          <supported-method name="TRACE" />
          <supported-method name="UNLOCK" />
        </supported-method-set>
      </prop>
      <status>HTTP/1.1 200 OK</status>
    </propstat>
  </response>
</multistatus>

这篇关于WebDAV的最小请求响应周期示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆