GET request, unwrap `ApiResponse` envelope.
(&self, path: &str)
| 148 | |
| 149 | /// GET request, unwrap `ApiResponse` envelope. |
| 150 | pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> { |
| 151 | let url = format!("{}{}", self.base_url, path); |
| 152 | log::debug!("GET {}", url); |
| 153 | |
| 154 | let resp = self |
| 155 | .http |
| 156 | .get(&url) |
| 157 | .send() |
| 158 | .await |
| 159 | .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?; |
| 160 | |
| 161 | self.handle_response(resp).await |
| 162 | } |
| 163 | |
| 164 | /// POST request with JSON body, unwrap `ApiResponse` envelope. |
| 165 | pub async fn post<B: Serialize, T: DeserializeOwned>( |
nothing calls this directly
no test coverage detected