Properties of a file or directory

The section Changing the properties of a file or directory (PROPPATCH) describes how properties are created.

If the request body does not indicate specific properties, Yandex Disk sends the following in the response:

  • Date and time the object was modified.
  • Whether the object is a directory.
  • For files, the size and type of contents.

Request for the value of the myprop property for the /a/ directory:

PROPFIND /a/ HTTP/1.1
Host: webdav.yandex.ru
Accept: */*
Depth: 1
Authorization: OAuth 0c4181a7c2cf4521964a72ff57a34a07
Content-Length: 115
Content-Type: application/x-www-form-urlencoded
 
<?xml version="1.0" encoding="utf-8" ?>
<propfind xmlns="DAV:">
  <prop>
    <myprop xmlns="mynamespace"/>
  </prop>
</propfind>

If the directory exists and it has this property, the following response is returned:

HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 252
 
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:">
  <d:response>
    <d:href>/a/</d:href>
    <d:propstat>
      <d:status>HTTP/1.1 200 OK</d:status>
      <d:prop>
        <myprop xmlns="mynamespace">
          myvalue
        </myprop>
      </d:prop>
    </d:propstat>
  </d:response>
</d:multistatus>