diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-08-19 19:32:49 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-08-19 19:32:49 +0200 |
commit | 9abac137c5282d3bd78776e9da3608c3a32cb49f (patch) | |
tree | d874eafbb19788326e4b9e7c29ddd0bce600cec1 /src | |
parent | f5bdd3f122138e6ea0a8eafedfaf900862070507 (diff) | |
download | rust-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.rs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 } |