src/client/http_client.rs: trim path
This commit is contained in:
parent
7f1685230a
commit
591f570b22
@ -79,6 +79,7 @@ impl HttpClient {
|
|||||||
|
|
||||||
pub fn get(&self, path: &str) -> Result<Value, Error> {
|
pub fn get(&self, path: &str) -> Result<Value, Error> {
|
||||||
|
|
||||||
|
let path = path.trim_matches('/');
|
||||||
let url: Uri = format!("https://{}:8007/{}", self.server, path).parse()?;
|
let url: Uri = format!("https://{}:8007/{}", self.server, path).parse()?;
|
||||||
|
|
||||||
let ticket = self.login()?;
|
let ticket = self.login()?;
|
||||||
@ -128,6 +129,7 @@ impl HttpClient {
|
|||||||
|
|
||||||
pub fn upload(&self, content_type: &str, body: Body, path: &str) -> Result<Value, Error> {
|
pub fn upload(&self, content_type: &str, body: Body, path: &str) -> Result<Value, Error> {
|
||||||
|
|
||||||
|
let path = path.trim_matches('/');
|
||||||
let url: Uri = format!("https://{}:8007/{}", self.server, path).parse()?;
|
let url: Uri = format!("https://{}:8007/{}", self.server, path).parse()?;
|
||||||
|
|
||||||
let ticket = self.login()?;
|
let ticket = self.login()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user