From 9abac137c5282d3bd78776e9da3608c3a32cb49f Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 19 Aug 2018 19:32:49 +0200 Subject: Add method for fetching network stream. --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib.rs') 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 { + self.fetch_stream(ZOTAPI_NETWORK_STREAM_PATH) + } + fn url(&self, path: &str) -> String { self.base_url.clone() + path } -- cgit v1.2.3