#reqwest #webdav #async #tokio #hash #digest #client #build #dav #mv

reqwest_dav

An async webdav client with tokio and reqwest

2 releases

Uses new Rust 2021

0.1.1 Sep 9, 2022
0.1.0 Sep 9, 2022

#417 in Cryptography

MIT license

26KB
674 lines

Reqwest dav

An async webdav client for rust with tokio and reqwest

Features

  • Authentication
    • Basic
    • Digest
  • Files management
    • Get
    • Put
    • Mv
    • Delete
    • Mkcol
    • List

Examples

use crate::{Auth, ClientBuilder, Depth, Error};

#[tokio::test]
async fn it_works() -> Result<(), Error> {
  
    // build a client
    let client = ClientBuilder::new()
        .set_host("http://server/remote.php/dav/files/username/".to_string())
        .set_auth(Auth::Basic("username".to_owned(), "password".to_owned()))
        .build()?;

    // list files
    println!(
        "{}",
        serde_json::to_string(&client.list("", Depth::Infinity).await?).unwrap()
    );
  
    // delete a file
    client.delete("1.txt").await.unwrap();

    Ok(())
}

Dependencies

~7–16MB
~314K SLoC