WebDAVClient 2.3.0

dotnet add package WebDAVClient --version 2.3.0
                    
NuGet\Install-Package WebDAVClient -Version 2.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WebDAVClient" Version="2.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WebDAVClient" Version="2.3.0" />
                    
Directory.Packages.props
<PackageReference Include="WebDAVClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WebDAVClient --version 2.3.0
                    
#r "nuget: WebDAVClient, 2.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WebDAVClient@2.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WebDAVClient&version=2.3.0
                    
Install as a Cake Addin
#tool nuget:?package=WebDAVClient&version=2.3.0
                    
Install as a Cake Tool

WebDAVClient

Overview

WebDAV Client for .Net Core, strongly typed, async and open-sourced, imnplemented in C#.

WebDAVClient is based originally on https://github.com/kvdb/WebDAVClient. I've added Async support (instead of Callback), as well strong-types responses.

NuGet

WebDAVClient is available as a NuGet package

Features

  • Available as a NuGet packages
  • Fully support Async/Await
  • Strong-typed
  • Implemented using HttpClient, which means support for extendibility such as throttling and monitoring
  • Supports Unauthenticated or Windows Authentication-based access
  • Supports custom Certificate validation
  • Supports the full WebDAV API:
    • Retrieving files & folders
    • Listing items in a folder
    • Creating & deleting folders
    • Downloading & uploading files
    • Downloading & uploading partial content
    • Moving & copying files and folders

Release Notes

  • 2.2.1 Minor packaging improvements
  • 2.2.0 Improvement:
    • Implement IDisposable to avoid HttpClient leak
    • Added support for CancellationToken
    • Various performance improvements to reduce memory allocations
    • Minor code cleanup
  • 2.1.0 Bug fixes: Fixed handling of port
  • 2.0.0 BREAKING CHANGES!!!
    • Added support for .Net Core 3.0 & .Net Standard 2.0
  • 1.1.3 Improvement:
    • Ignore WhiteSpaces while parsing response XML
    • Enable Windows Authentication
    • Support curstom certificate validation
    • Add download partial content
    • Improved testability by using a wrapper for HttpClient
  • 1.1.2 Improvements:
    • Make WebDAVClient work on Mono and make NuGet compatible with Xamarin projects
    • Provide a IWebProxy parameter for HttpClient
    • Change type of ContentLength from int to long
    • Improved compatibility to SVN
  • 1.1.1 Improvements:
    • Improved parsing of server responses
    • Improved the way we calculate URLs
  • 1.1.0 Improvement: Improved parsing of server values
  • 1.0.23 Improvement: Improve the way we handle path with "invalid" characters
  • 1.0.22 Bug fixes and improvements:
    • Improved the way we identify the root folder
    • Fixed calculation of URLs
  • 1.0.20 Improvements:
    • Added support for default/custom UserAgent
    • Improved ToString method of WebDAVException
  • 1.0.19 Improvement: Added support for uploads timeout
  • 1.0.18 Improvement: Added MoveFolder and MoveFile methods
  • 1.0.17 Improvement: Added DeleteFolder and DeleteFile methods
  • 1.0.16 Improvements:
    • Improved filtering of listed folder
    • Disable ExpectContinue header from requests
  • 1.0.15 Bug fixes: Trim trailing slashes from HRef of non-collection (files) items
  • 1.0.14 BREAKING CHANGES: Replaced Get() method with separated GetFolder() and GetFile() methods.
  • 1.0.13 Improvement: Replaced deserialization mechanism with a more fault-tolerant one.
  • 1.0.12 Bug fixes: Removed disposing of HttpMessageResponse when returning content as Stream
  • 1.0.11 Improvements:
    • Introduced new IClient interface
    • Added new WebDAVConflictException
    • Dispose HttpRequestMessage and HttpResponseMessage after use
  • 1.0.10 Bug fixes: Correctly handle NoContent server responses as valid responses
  • 1.0.9 Bug fixes: Improved handling of BasePath
  • 1.0.8 Bug fixes: Handle cases when CreationDate is null
  • 1.0.7 Async improvements: Added ConfigureAwait(false) to all async calls
  • 1.0.5 Bug fixes and improvements:
    • Decode Href property of files/folders
    • Complete Http send operation as soon as headers are read
  • 1.0.3 Various bug fixes.
  • 1.0.1 Improved error handling and authentication
  • 1.0.0 Initial release.

Usage

// Basic authentication required
IClient c = new Client(new NetworkCredential { UserName = "USERNAME" , Password = "PASSWORD"});
// OR without authentication
var client = new WebDAVClient.Client(new NetworkCredential());

// Set basic information for WebDAV provider
c.Server = "https://dav.dumptruck.goldenfrog.com/";
c.BasePath = "/dav/";

// List items in the root folder
var files = await c.List();

// Find folder named 'Test'
var folder = files.FirstOrDefault(f => f.Href.EndsWith("/Test/"));
// Reload folder 'Test'
var folderReloaded = await c.GetFolder(folder.Href);

// Retrieve list of items in 'Test' folder
var folderFiles = await c.List(folderReloaded.Href);
// Find first file in 'Test' folder
var folderFile = folderFiles.FirstOrDefault(f => f.IsCollection == false);

var tempFileName = Path.GetTempFileName();

// Download item into a temporary file
using (var tempFile = File.OpenWrite(tempFileName))
using (var stream = await c.Download(folderFile.Href))
	await stream.CopyToAsync(tempFile);

// Update file back to webdav
var tempName = Path.GetRandomFileName();
using (var fileStream = File.OpenRead(tempFileName))
{
	var fileUploaded = await c.Upload(folder.Href, fileStream, tempName);
}

// Create a folder
var tempFolderName = Path.GetRandomFileName();
var isfolderCreated = await c.CreateDir("/", tempFolderName);

// Delete created folder
var folderCreated = await c.GetFolder("/" + tempFolderName);
await c.DeleteFolder(folderCreated.Href);

Contact

You can contact me on twitter @saguiitay.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on WebDAVClient:

Package Downloads
SuperiorAcumaticaPackage

Dependencies required to compile the SuperiorAcumaticaSolution for Acumatica 2025 R1 Build 25.101.0153

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on WebDAVClient:

Repository Stars
SaboZhang/EasyTidy
EasyTidy A simple file auto-classification tool makes it easy to create automatic workflows with files. / EasyTidy 一个简单的文件自动分类整理工具 轻松创建文件的自动工作流程
Version Downloads Last Updated
2.3.0 19 9/4/2025
2.2.1 34,702 8/25/2023
2.2.0 232 8/25/2023
2.1.0 65,428 8/25/2021
2.0.0 5,667 11/19/2020
1.1.4 7,993 6/20/2018
1.1.3 4,771 11/18/2017
1.1.2 108,646 8/8/2016
1.1.1 30,722 12/27/2015
1.1.0 1,401 12/13/2015
1.0.23 1,481 12/10/2015
1.0.21 9,046 9/2/2015
1.0.20 1,769 8/13/2015
1.0.19 1,677 3/19/2015
1.0.18 1,389 3/13/2015
1.0.17 1,358 3/13/2015
1.0.16 1,359 3/11/2015
1.0.15 1,453 3/1/2015
1.0.14 1,382 3/1/2015
1.0.13 1,611 2/17/2015
1.0.12 1,712 2/15/2015
1.0.11 1,393 2/1/2015
1.0.10 1,409 1/29/2015
1.0.9 1,393 1/29/2015
1.0.8 1,384 1/28/2015
1.0.7 1,412 1/27/2015
1.0.6 1,694 1/23/2015
1.0.5 1,444 1/15/2015
1.0.4 2,095 10/22/2014
1.0.3 1,388 10/11/2014
1.0.2 1,435 10/10/2014
1.0.1 1,419 10/8/2014
1.0.0 1,939 10/6/2014

* Implement `IDisposable` to avoid `HttpClient` leak
* Added support for `CancellationToken`
* Various performance improvements to reduce memory allocations
* Minor code cleanup