MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / delete

Method delete

atomic-remote/src/storage.rs:188–207  ·  view source on GitHub ↗

DELETE request, returns `()` on success.

(&self, path: &str)

Source from the content-addressed store, hash-verified

186
187 /// DELETE request, returns `()` on success.
188 pub async fn delete(&self, path: &str) -> Result<(), RemoteError> {
189 let url = format!("{}{}", self.base_url, path);
190 log::debug!("DELETE {}", url);
191
192 let resp = self
193 .http
194 .delete(&url)
195 .send()
196 .await
197 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
198
199 crate::check_min_version_header(resp.headers());
200 let status = resp.status();
201 if status.is_success() {
202 Ok(())
203 } else {
204 let body = resp.text().await.unwrap_or_default();
205 Err(self.parse_error_body(status.as_u16(), &body))
206 }
207 }
208
209 /// Handle a response: check status, parse `ApiResponse<T>`, unwrap data.
210 async fn handle_response<T: DeserializeOwned>(

Callers 2

delete_workspaceMethod · 0.45
delete_projectMethod · 0.45

Calls 5

check_min_version_headerFunction · 0.85
textMethod · 0.80
parse_error_bodyMethod · 0.80
statusMethod · 0.45
is_successMethod · 0.45

Tested by

no test coverage detected