reqwest_dav

Crates.ioreqwest_dav
lib.rsreqwest_dav
version0.1.11
sourcesrc
created_at2022-09-09 07:55:01.132562
updated_at2024-04-27 11:38:53.490575
descriptionAn async webdav client with tokio and reqwest
homepage
repositoryhttps://github.com/niuhuan/reqwest_dav
max_upload_size
id661619
size50,379
(niuhuan)

documentation

README

Reqwest dav

crates.io Documentation MIT/Apache-2 licensed CI

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(())
}
Commit count: 32

cargo fmt