Perform a request that returns no meaningful body.
(
&self,
method: hyper::Method,
path: &str,
body: Option<&Value>,
)
| 377 | |
| 378 | /// Perform a request that returns no meaningful body. |
| 379 | async fn request_ok( |
| 380 | &self, |
| 381 | method: hyper::Method, |
| 382 | path: &str, |
| 383 | body: Option<&Value>, |
| 384 | ) -> Result<(), PodmanApiError> { |
| 385 | let (status, bytes) = self.request(method, path, body, API_TIMEOUT).await?; |
| 386 | let code = status.as_u16(); |
| 387 | if status.is_success() || code == 304 { |
| 388 | Ok(()) |
| 389 | } else { |
| 390 | Err(error_from_response(code, &bytes)) |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | /// POST a JSON body and ignore 409 Conflict (resource already exists). |
| 395 | async fn create_ignore_conflict(&self, path: &str, body: &Value) -> Result<(), PodmanApiError> { |
no test coverage detected