You are looking at historical revision 11387 of this page. It may differ significantly from its current revision.

Introduction

The webdav-client library contains client-side routines for distributed authoring (RFC 2518).

Requires

http
http-auth
syntax-case
matchable
sxml-transforms
sxml-tools
utf8

Library conventions

Every WebDAV client procedure in this library takes a PATH argument, which can be a string that contains the resource URL, or a list of the form (AUTH PATH), where AUTH is a procedure of the form LAMBDA TYPE * REALM -> (USER PASS) that takes in HTTP authentication type and realm, and returns user name and password for the realm, and PATH is again the resource URL.

Library procedures

webdav:get:: PATH [ * HANDLER] -> ...

Executes a GET request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

webdav:put:: PATH * CONTENT [ * LOCKTOKEN * HANDLER] -> ...

Executes a PUT request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

webdav:delete:: PATH [ * HANDLER] -> ...

Executes a DELETE request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

webdav:copy:: FROM-PATH * TO-PATH [ * OVERWRITE? * LOCKTOKEN * HANDLER] -> ...

Executes a COPY request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body. Argument TO-PATH must be a string.

webdav:move:: FROM-PATH * TO-PATH [ * OVERWRITE? * LOCKTOKEN * HANDLER] -> ...

Executes a MOVE request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body. Argument TO-PATH must be a string.

webdav:propfind:: PATH [ * PROPNAMES * DEPTH * HANDLER] -> ...

Executes a PROPFIND request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

webdav:proppatch:: PATH [ * NAMESPACES * SETPROPS * DELPROPS * LOCKTOKEN * HANDLER] -> ...

Executes a PROPPATCH request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

webdav:lock:: PATH * OWNER [ SCOPE * DEPTH * TIMEOUT * LOCKTOKEN * HANDLER] -> ...

Executes a LOCK request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

webdav:lock:: PATH [ * LOCKTOKEN * HANDLER] -> ...

Executes an UNLOCK request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.

Example

(use webdav-client)
;; retrieve all properties of given resource
(webdav:propfind
 (list (lambda (type realm) (list "user" "pass")) ;; authentication information
 "http://localhost/file" ;; resource URL
))
;; PROPPATCH example from RFC 2518
(webdav:proppatch
 (list (lambda (type realm) (list "user" "pass")) 
 "http://localhost/file"
 `((Z "http://www.w3.com/standards/z39.50/")) ;; property namespaces
 `((Z:authors (Z:Author "Jim Whitehead")
              (Z:Author "Roy Fielding"))) ;; properties to set
 `((Z:Copyright-Owner)) ;; properties to delete
))

Authors

Ivan Raikov

Version

1.1
Fixes to the meta file
1.0
Initial version

License

Copyright 2008 Ivan Raikov.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A full copy of the GPL license can be found at <http://www.gnu.org/licenses/>.