PROPFIND Method

Topic Last Modified: 2006-06-13

The WebDAV PROPFIND Method retrieves properties for a resource identified by the request Uniform Resource Identifier (URI). The PROPFIND Method can be used on collection and property resources.

When a PROPFIND Method or a BPROPFIND Method request contains a Brief Header with a value of "t", every propstat XML Element with a status of 404 (Not Found) is omitted from the 207 (Multi-Status) response.

Clients may submit a Depth Header with a value of "0", "1", "1,noroot" or "infinity". A PROPFIND Method without a Depth Header acts as if a Depth Header value of "infinity" was included.

Note

A PROPFIND with depth value of "infinity" is not supported in the public store that is accessible to MAPI clients such as Microsoft® Outlook®.

The PROPFIND Method may be included in the scope of a transaction by submitting a Transaction Header with a lock token that corresponds to that transaction.

Note

See Authentication and Security Using WebDAV for more information.

The list of WebDAV Protocol Status Codes in the following table is not comprehensive. For information about 500-level status codes, see WebDAV Status Codes: 500s.

Status Codes

The following are response codes that can be expected to be used in a 207 (Multi-Status) response for this method.

Status Code Meaning

200 (OK)

The command succeeded.

403 (Forbidden)

The client does not have access to the property.

404 (Not Found)

The property could not be found.

Example

The following example illustrates a WebDAV PROPFIND Method request and response.

The following example uses the allprop XML Element to retrieve all properties on a collection. The Depth Header is set to 0, so the method request only applies to the collection and not its children.

The following example illustrates using the WebDAV PROPFIND Method to discover lock and transaction support on a resource. This is done by retrieving the supportedlock Field.

Request

PROPFIND /public/docs/myFile.doc HTTP/1.1
Content-Type: text/xml
Content-Length: XXX
Depth: 0
Translate: f
...

<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop><a:getcontenttype/></a:prop>
<a:prop><a:getcontentlength/></a:prop>
</a:propfind>

Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml
Content-Length: 310

<?xml version="1.0"?>
<a:multistatus
  xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
  xmlns:a="DAV:">
 <a:response>
   <a:href>https://server/public/test2/item1.txt</a:href>
   <a:propstat>
    <a:status>HTTP/1.1 200 OK</a:status>
       <a:prop>
        <a:getcontenttype>text/plain</a:getcontenttype>
        <a:getcontentlength b:dt="int">33</a:getcontentlength>
       </a:prop>
   </a:propstat>
 </a:response>
</a:multistatus>

Request

BPROPFIND /public/container/ HTTP/1.1
Host: www.contoso.com
Depth: 0
Content-type: text/xml;
Content-Length: xxxx

<?xml version="1.0" ?>
<D:propfind xmlns:D="DAV:">
        <D:allprop/>
</D:propfind>

Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml
Content-Length: xxxx

<?xml version="1.0" ?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
       <D:href>https://www.contoso.com/public/container/</D:href>
       <D:propstat>
            <D:prop xmlns:R="https://www.contoso.com/schema/">
                 <R:author>Rob Caron</R:author>
                 <R:editor>Jessup Meng</R:editor>
                 <D:creationdate>
                    1999-11-01T17:42:21-06:30
                 </D:creationdate>
                 <D:displayname>
                    Example Collection
                 </D:displayname>
                 <D:resourcetype><D:collection></D:resourcetype>
                 <D:supportedlock>
                    <D:lockentry>
                       <D:lockscope><D:shared/></D:lockscope>
                       <D:locktype><D:write/></D:locktype>
                    </D:lockentry>
                 </D:supportedlock>
              </D:prop>
              <D:status>HTTP/1.1 200 OK</D:status>
           </D:propstat>
        </D:response>
</D:multistatus>

Request

PROPFIND /public/docs/ HTTP/1.1
Host: www.contoso.com
Content-Type: text/xml

<?xml version="1.0"?>
<D:propfind xmlns:D="DAV:">
   <D:prop><D:supportedlock/></D:prop>
</D:propfind>

Response

HTTP/1.1 207 Multi-Status
Content-Type: text/xml

<?xml version="1.0"?>
<a:multistatus xmlns:a="DAV:">
 <a:response>
   <a:href>https://www.contoso.com/public/docs/</a:href>
   <a:propstat>
    <a:prop>
       <a:supportedlock>
          <a:lockentry>
             <a:lockscope><a:local/></a:lockscope>
             <a:locktype>
                <a:transaction><a:local/></a:transaction>
             </a:locktype>
          </a:lockentry>
          <a:lockentry>
             <a:lockscope><a:shared/></a:lockscope>
             <a:locktype><a:write/></a:locktype>
          </a:lockentry>
       </a:supportedlock>
    </a:prop>
    <a:status>HTTP/1.1 200 OK</a:status>
   </a:propstat>
 </a:response>
</a:multistatus>