aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-08-19 19:32:49 +0200
committerHarald Eilertsen <haraldei@anduin.net>2018-08-19 19:32:49 +0200
commit9abac137c5282d3bd78776e9da3608c3a32cb49f (patch)
treed874eafbb19788326e4b9e7c29ddd0bce600cec1 /src
parentf5bdd3f122138e6ea0a8eafedfaf900862070507 (diff)
downloadrust-zotapi-9abac137c5282d3bd78776e9da3608c3a32cb49f.tar.gz
rust-zotapi-9abac137c5282d3bd78776e9da3608c3a32cb49f.tar.bz2
rust-zotapi-9abac137c5282d3bd78776e9da3608c3a32cb49f.zip
Add method for fetching network stream.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d87e6d0..84c1340 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,6 +8,7 @@ use reqwest::{
use std::io::Read;
const ZOTAPI_CHANNEL_STREAM_PATH : &str = "/api/z/1.0/channel/stream";
+const ZOTAPI_NETWORK_STREAM_PATH : &str = "/api/z/1.0/network/stream";
#[derive(Debug)]
pub enum Error {
@@ -41,6 +42,10 @@ impl Client {
self.fetch_stream(ZOTAPI_CHANNEL_STREAM_PATH)
}
+ pub fn network_stream(&self) -> Result<String, Error> {
+ self.fetch_stream(ZOTAPI_NETWORK_STREAM_PATH)
+ }
+
fn url(&self, path: &str) -> String {
self.base_url.clone() + path
}