Changing the properties of a file or directory (PROPPATCH)
Use the PROPPATCH method to change the properties of a file or directory on Yandex Disk. Applications can create their own custom properties for files and directories, for storing metainformation. Values of created properties can be requested using the PROPFIND method (see Properties of a file or directory).
The XML elements that are used in requests and responses are documented in the protocol specification.
For the /a/ directory, the
myprop
property is created with themyvalue
value.
PROPPATCH /a/ HTTP/1.1 Host: webdav.yandex.ru Accept: */* Authorization: OAuth 0c4181a7c2cf4521964a72ff57a34a07 Content-Length: 159 Content-Type: application/x-www-form-urlencoded <?xml version="1.0" encoding="utf-8" ?> <propertyupdate xmlns="DAV:" xmlns:u="mynamespace"> <set><prop> <u:myprop>myvalue</u:myprop> </prop></set> </propertyupdate>
Request response:
HTTP/1.1 207 Multi-Status Content-Type: application/xml; charset="utf-8" Content-Length: 235 <?xml version="1.0" encoding="utf-8"?> <d:multistatus xmlns:d="DAV:"> <d:response> <d:href>/</d:href> <d:propstat> <d:status>HTTP/1.1 200 OK</d:status> <d:prop> <myprop xmlns="mynamespace"/> </d:prop> </d:propstat> </d:response> </d:multistatus>