Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between GET and PROPFIND in WebDAV

Tags:

http

webdav

According to WebDAV specification (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].

and PROPFIND

retrieves properties defined on the resource identified by the Request-URI.

So GET and PROPFIND more or less retrieve the information of a resource. In this sense, is there any major difference between GET and PROPFIND and when should one be used instead of the other.

like image 369
NullReference Avatar asked Nov 09 '15 11:11

NullReference


1 Answers

The very paragraph, you refer to, explains it:

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.

I.e. the GET behaves as it historically did, to maintain a backward compatibility. It will typically return an "index" page (file index.html, index.php or similar) or it will automatically render an HTML page with a directory contents (a file list). This means the WebDAV server can run on the same port as HTTP server (= as an extension of the HTTP server), with the existing HTTP requests behaving the same.

While the WebDAV PROPFIND request will return an exactly defined, machine-readable, XML document, according to the WebDAV specification.


If you are implementing a WebDAV client or server, you are interested in the PROPFIND only. A GET response does not have a defined format (not even content), so it cannot be parsed by an application.

like image 119
Martin Prikryl Avatar answered Sep 21 '22 18:09

Martin Prikryl