aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs
index 5381286..7a54825 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -118,6 +118,14 @@ impl Client {
handle_result(res)
}
+
+ /// Return a RequestBuilder object that's set up with the correct
+ /// path and headers for performing a zot api request.
+ pub fn get(&self, path: &str) -> reqwest::RequestBuilder {
+ self.inner.get(&self.url(path, &()))
+ .header(ACCEPT, "application/json")
+ .basic_auth(self.user.clone(), Some(self.pw.clone()))
+ }
}
// A common function for handling the response after a request.