Skip to content
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.
DecaTec edited this page Mar 8, 2019 · 3 revisions

The Portable WebDAV Library has full HTTP/2 support and uses HTTP/2 as default.

When you cannot use HTTP/2, use the property HttpVersion or an overloaded constructor of WebDavClient/WebDavSession in order to set a different HTTP version:

public async Task<IList<WebDavSessionItem>> List()
{
    // The base URL of the WebDAV server.
    var webDavServerUrl = @"http://www.myserver.com/webdav/";

    // Specify the user credentials and use it to create a WebDavSession instance.
    var credentials = new NetworkCredential("MyUsername", "MyPassword");

    using (var webDavSession = new WebDavSession(webDavServerUrl, credentials, new Version(2, 0)))
    {
        // Set HTTP version to 1.1:
        webDavSession.HttpVersion = new Version(1, 1);

        var list = await webDavSession.ListAsync("/");
        return list;
    }
}
Clone this wiki locally