tengqianfrance

PROPFIND-WEBDAV

1.difference between PROPFIND and GET

REFERENCE: https://webmasters.stackexchange.com/questions/59211/what-is-http-method-propfind-used-for

From Wikipedia:

Web Distributed Authoring and Versioning (WebDAV) is an extension of the Hypertext Transfer Protocol (HTTP) that facilitates collaboration between users in editing and managing documents and files stored on World Wide Web servers.

PROPFIND — used to retrieve properties, stored as XML, from a web resource. It is also overloaded to allow one to retrieve the collection structure (a.k.a. directory hierarchy) of a remote system.

GET actually retrieves the resource. HEAD is similar to GET except that the message body is not returned. That is, it gets the file header information and not the entire resource.

It appears that PROPFIND differs from HEAD in that properties data stored as XML is returned in the message body (of the packet) rather than attempting to return the entire resource. OpenOffice and Libre documents contain XML as compared to the proprietary format that Microsoft and others use.


2. example of PROPFIND packets exchange

REFERENCE: https://stackoverflow.com/questions/10144148/example-of-a-minimal-request-response-cycle-for-webdav

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>

Response:

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>https://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>

评论

热度(2)