(&self, path: &str)
| 231 | } |
| 232 | |
| 233 | fn request_url(&self, path: &str) -> String { |
| 234 | if path.is_empty() || path == "/" { |
| 235 | self.base_url.clone() |
| 236 | } else if path.starts_with('/') { |
| 237 | format!("{}{}", self.base_url, path) |
| 238 | } else { |
| 239 | format!("{}/{}", self.base_url, path) |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | async fn parse_response<T: DeserializeOwned>(&self, resp: reqwest::Response) -> Result<T> { |
| 244 | let status = resp.status(); |