aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs
index bce4d08..374cfb2 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -132,4 +132,22 @@ impl Client {
_ => Err(Error::Unknown)
}
}
+
+ pub fn post_multipart<T>(&self, path: &str, _data: &T, _files: &Vec<&str>) -> Result<String, Error>
+ where T: Serialize,
+ {
+ let url = self.url(path, &());
+ let f = reqwest::multipart::Form::new()
+ .text("balle", "klorin");
+
+ let res = self.inner.post(&url)
+ .basic_auth(self.user.clone(), Some(self.pw.clone()))
+ .header(CONTENT_TYPE, "multipart/form-data")
+ .multipart(f)
+ .send()?;
+
+ match res.status() {
+ _ => Err(Error::Unknown)
+ }
+ }
}