POST with no request body, unwrap `ApiResponse` envelope.
(&self, path: &str)
| 126 | |
| 127 | /// POST with no request body, unwrap `ApiResponse` envelope. |
| 128 | pub async fn post_empty<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> { |
| 129 | let url = format!("{}{}", self.base_url, path); |
| 130 | log::debug!("POST {} (no body)", url); |
| 131 | |
| 132 | let resp = self |
| 133 | .http |
| 134 | .post(&url) |
| 135 | .send() |
| 136 | .await |
| 137 | .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?; |
| 138 | |
| 139 | self.handle_response(resp).await |
| 140 | } |
| 141 | |
| 142 | /// PUT request with JSON body, unwrap `ApiResponse` envelope. |
| 143 | pub async fn put<B: Serialize, T: DeserializeOwned>( |
no test coverage detected