Whats New

October 5, 2002

A new release (1.9) which includes a number of bug fixes plus new callbacks for SSL Certificate management and client certificate management.

The DAVLib source code is available via anonymous CVS in a repository hosted at SourceForge.net.


This library abstracts WebDAV client functionality into a simple object mode. It encapsulates many specifics of the WebDAV protocol and instead exposes a set of C++ classes which can be used for web site content management. Handling of XML documents which are passed as part of the DAV protocol is also handled internally to the library.


There are 2 parts to DAVLib; lower level classes that directly implement HTTP/1.1, RFC2518 (WebDAV) and XML parsing, and higher level classes that expose DAV servers in an object model.

On MacOS, the lower level classes are designed to be plug-in replacements for the Internet Networking classes found in Metrowerks PowerPlant. They are styled and modeled after those classes, and expose HTTP as a simple API that works on message objects and that populates response objects.

The main classes in the higher level portions of the library are CDAVContext and CDAVRequest. CDAVContext defines the parameters required to contact a DAV server, such as server host name, port, user authentication and proxying information. CDAVRequest is the class that executes the transactions with a DAV server. This is where all of the high level operations (such as listDirectory, FindAllProperties, DeleteResource, etc) are defined. Various object types that returned; this object model abstracts out XML processing inherent in WebDAV and exposes a clean object oriented interface to a DAV repository.

Assuming that a CDAVRequest object (req) is in the scope of this code, here is a sample snippet of code:

   CDAVItemVector kids;

   CDAVPropertyVector props;

   LStr255 theResource = "/dav";

   props.push_back(new CDAVProperty("http://www.webdav.org/goliath", "CreaterOSType"));


   if (CDAVRequest::SUCCESS == req->ListDirectory(aThread, theResource, kids, props)) {

      //operate on the returned vector of DAV items

      CDAVItemVector::iterator iter = kids.begin();

      while (iter != kids.end()) {




   } else {

        //handle the error gracefully....



Note that this library uses STL and most of the data types are templated.


HeaderDoc generated HTML documentation for DAVLib can be found here


The latest version (1.9) of these classes can be found here (approximately 408 kb Stuff-It archive). CodeWarrior Pro 7.1 or greater is required to build this library.

An archive of older releases can be found here.

DAV Example Application

An example application that uses the low level RFC2518 clases in DAVLib (and can be used for DAV exploration and testing) can be found at http://www.webdav.org/goliath/davexample.html

Goliath Mailing List

A mailing list has been created to discuss Goliath/DAVLib specifically and WebDAV on the Mac in general. Information about this mailing list can be found at http://mailman.lyra.org/mailman/listinfo/goliath


These classes are protected under the GNU General Public License, version 2.0. Contact the author to negotiate alternate licensing terms.

Known Issues


Contact Information

You can contact the author by e-mail at tbednarz@webdav.org

Please report any defects discovered in this software.

Example Code
Mailing List
Known Issues
Version History

Version History

  • 1.0 - Sept 7, 1999. Initial version, 1.0.
  • 1.1 - Sept 28, 1999. Version 1.1; added new method to obtain properties of a resource; fixed issue with HREF attributes with the ShareMation server, and also fixed an issue with the CDAVRequest copy constructor.
  • 1.1.1 - Sept 29, 1999. Fixed problem listing directories on Apache mod_dav servers
  • 1.1.2 - Oct 10, 1999. Relicensed code under the GNU GPL.
  • 1.5 - Jan 9, 2000. Added the OPTIONS HTTP method. Refactored code from CDAVRequest into the CDAVContext class. Fixed bug where any HTTP/DAV response over 32k was not processed properly. Added missing HTTP 1.1 feature - support for chunked transfer encoding.
  • 1.5.1 - January 29, 2000. Tightened up XML parsing strictness; removed some code that erroneously dealt with bad XML because of improper handling of the HTTP 1.1 chunked transfer encoding. Fixed a bug in CDAVRequest::GetResource where in some cases, the downloaded file's length was errantly set to zero, nulling out the data. Work done with CDAVRequest::GetResource; Internet config is now used to type the newly created files. Also fixed a PowerPlant bug where files are made zero length if temporary files are used in the LDynamicBuffer class. Finally, fixed bug in CDAVContext where the field m_hasUserCred was not initially set to anything in the objects constructor.
  • 1.5.2 - January 30, 2000. Integrated version 1.1 of the Expat parser and removed XML namespace manipluation code from parsexml.cpp/h. The XML namespace code was replaced with the new built-in XML namespace processing in Expat. Fixes a crashing bug reported by Bill Bumgarner.
  • 1.5.3 - February 3, 2000. Removed extraenous CRLF CDAVConnection::SendCommandWithReply, HTTP requests should now be valid HTTP requests. This bug was carried through from a Metrowerks bug and fixes many IIS5 connection issues. Fixed status checking in CDAVRequest::DeleteResource to also include 200 and 207 as valid resonses for DELETE. DAVLib was errantly setting content-type on MKCOL, updated method CDAVRequest::CreateDirectory. Changed code that appends the Destination field to the HTTP header to not fold the header anymore. This fixes some MOVE and COPY issues with MS IIS5. Added code to handle the case where a server returns a status of 100 Continue. DAVLib doesn't send an Expect: header, but there are cases in RRF 2068 (most notably Post) where a server may elect to return a 100 to an HTTP 1.1 even if the Expect header is absent.
  • 1.6 - March 29, 2000. Resources are now properly URL encoded and decoded. Added support for If and Lock-Token HTTP Headers. Cleaned up Lock and Unlock HTTP code. Added High level Lock and Unlock API calls to CDAVRequest. Added lock support to PUT, CreateCollection, DeleteResource. Added new function; CDAVRequest::GetResourceExists.
  • 1.7 - July 16, 2000.
    • added support for basic proxy authentication to CDAVMessage and CDAVContext
    • added CDAVContext::equals
    • added LListeners to all public APIs
    • overrode SendData in CDAVConnection to fix a broadcast bug on the progress sending bytes on a send.
    • added a cancellation function to CDAVRequest; only works for PutResource and GetResource though.
    • added a Depth parameter to ListDirectory
    • upated Headers to include HeaderDoc comments
    • assorted code changes to port to Carbon
    • added CDAVRequest::SetItemProperty and CDAVRequest::RemoveItemProperty
    • added CDAVItem::RemoveProperty
    • fixed issue in CDAVRequest::ListDirectory (exposed by some required carbon changes in XML parsing) where an item's HREF is truncated in some situations. Chance of this happening in MacOS Classic are very remote but possible; the noted carbon changes made more prevalent on OSX/OS9-carbon
    • added new CDAVTreeWalker class
  • 1.7L - July 20, 2000; fork of 1.7/MacOS code base. Does not include tree walking classes.
  • 1.7.1 - August 8, 2000; Minor bug fix release to sync with release of Goliath 0.7
  • 1.8 - October 21, 2000. Integrated patches from i-drive.com that implement SSL and change APIs to be C-string based instead of Pascal Strings. Added an HTTP logging feature to trace requests and responses to a log file. My thanks go to i-drive for supporting Open Source software!
  • 1.8.1 - October 2, 2001. Fixes bugs in persistent connections; now compatible with Apple's iDisk WebDAV servers.
  • 1.8.2 - November 22, 2001. Fixes a bug in proxy authentication. The CDAVMessage class was using the proxy user name as the password when constructing the proxy authentication HTTP header.
  • 1.8.5 - March 10, 2002. Fixes bugs in persistent HTTP connections. Will attempt a reconnect if the server issues an orderly disconnect.
  • 1.9 - October 4, 2002. Added Unicode transcoding utilities, fixed URL encoding (compliments of some code from Neon) ,added callbacks for SSL Certificate management and client certificate mgmt ,fixed cookie handling to accept cookies on HTTP/401 and to provide the cookie list when copying a CDAVConnection in a session (fixes some NetWare issues)

SourceForge Logo CVS services hosted by SourceForge.net

(c)1999-2002, Thomas Bednarz. All Rights Reserved

Last updated on 10/04/2002