dls config upload

This commit is contained in:
Mikaël Cluseau
2026-06-25 12:22:44 +02:00
parent 8246e237bf
commit ae6c62d5de
3 changed files with 166 additions and 363 deletions
+5
View File
@@ -77,6 +77,11 @@ impl Client {
Ok(resp.bytes_stream())
}
pub async fn upload_config(&self, config: &Config) -> Result<()> {
do_req(self.req(Method::POST, "configs")?.json(config), &self.token).await?;
Ok(())
}
pub async fn get_json<T: serde::de::DeserializeOwned>(&self, path: impl Display) -> Result<T> {
self.req_json(self.get(&path)?).await
}