client/http_client: add put method

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-11-13 10:38:48 +01:00 committed by Thomas Lamprecht
parent 58fcbf5ab7
commit 3c945d73c2
1 changed files with 9 additions and 0 deletions

View File

@ -534,6 +534,15 @@ impl HttpClient {
self.request(req).await self.request(req).await
} }
pub async fn put(
&mut self,
path: &str,
data: Option<Value>,
) -> Result<Value, Error> {
let req = Self::request_builder(&self.server, self.port, "PUT", path, data)?;
self.request(req).await
}
pub async fn download( pub async fn download(
&mut self, &mut self,
path: &str, path: &str,