POST with no request body, unwrap `ApiResponse` envelope.
(&self, path: &str)
| 183 | |
| 184 | /// POST with no request body, unwrap `ApiResponse` envelope. |
| 185 | pub async fn post_empty<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> { |
| 186 | let url = format!("{}{}", self.base_url, path); |
| 187 | log::debug!("POST {} (no body)", url); |
| 188 | |
| 189 | let resp = self |
| 190 | .http |
| 191 | .post(&url) |
| 192 | .send() |
| 193 | .await |
| 194 | .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?; |
| 195 | |
| 196 | self.handle_response(resp).await |
| 197 | } |
| 198 | |
| 199 | /// PUT request with JSON body, unwrap `ApiResponse` envelope. |
| 200 | pub async fn put<B: Serialize, T: DeserializeOwned>( |
no test coverage detected