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