Outdated egg!
This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for the CHICKEN 4 version of this egg, if it exists.
If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.
Introduction
The webdav-client library contains client-side routines for distributed authoring (RFC 2518).
Requires
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:options:: PATH [ * HANDLER] -> ...
Executes a OPTIONS request and invokes procedure HANDLER with the server response. The default handler returns an alist with the HTTP response status, headers, and body.
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 [ * PROPS * NAMESPACES * 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:report:: PATH [ * CONTENT * DEPTH * HANDLER] -> ...
Executes a REPORT 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 [ * SETPROPS * DELPROPS * NAMESPACES * 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.5
- Compatibility with utf8
- 1.4
- Changed the API of the webdav:report
- 1.3
- Added REPORT and OPTIONS methods; changed argument order of PROPFIND and PROPPATCH.
- 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/>.