| Crates.io | reqwest_dav |
| lib.rs | reqwest_dav |
| version | 0.2.2 |
| created_at | 2022-09-09 07:55:01.132562+00 |
| updated_at | 2025-08-28 05:53:00.271536+00 |
| description | An async webdav client with tokio and reqwest |
| homepage | |
| repository | https://github.com/niuhuan/reqwest_dav |
| max_upload_size | |
| id | 661619 |
| size | 128,265 |
An async webdav client for rust with tokio and reqwest
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".to_string())
.set_auth(Auth::Basic("username".to_owned(), "password".to_owned()))
.build()?;
// list files
println!(
"{}",
serde_json::to_string(&client.list("/remote.php/dav/files/username", Depth::Infinity).await?).unwrap()
);
// delete a file
client.delete("1.txt").await.unwrap();
Ok(())
}
set_host can use "http://server/remote.php/dav/files/username", but the list method return value from server usually the full path excluding the protocol and domain name, like /remote.php/dav/files/username/bookmarks.txt, you can use it according to your own server or needs.