diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-08-20 15:26:01 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-08-20 15:26:01 +0200 |
commit | 77763e9ce22c9eb173dec7aa29cf379d3b6b47ea (patch) | |
tree | 6481fda7d9a5f08cb5218aa817e60a524467da05 /src | |
parent | e3161f2e8561089d6db72f2a36011c7a5b54f320 (diff) | |
download | rust-zotapi-77763e9ce22c9eb173dec7aa29cf379d3b6b47ea.tar.gz rust-zotapi-77763e9ce22c9eb173dec7aa29cf379d3b6b47ea.tar.bz2 rust-zotapi-77763e9ce22c9eb173dec7aa29cf379d3b6b47ea.zip |
Remove create_item API.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -105,26 +105,6 @@ impl Client { ItemBuilder::new(self) } - pub fn create_item(&self, body: &str) -> Result<String, Error> { - let url = self.url(ZOTAPI_ITEM_UPDATE_PATH); - let mut res = self.inner.post(&url) - .header(Accept(vec![qitem(mime::APPLICATION_JSON)])) - .header(ContentType::form_url_encoded()) - .basic_auth(self.user.clone(), Some(self.pw.clone())) - .form(&[("body", body)]) - .send()?; - - match res.status() { - StatusCode::Unauthorized => Err(Error::Unauthorized), - StatusCode::Ok => { - let mut body = String::new(); - res.read_to_string(&mut body)?; - Ok(body) - }, - _ => Err(Error::Unknown) - } - } - fn url(&self, path: &str) -> String { self.base_url.clone() + path } |