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

Method delete

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

DELETE request, returns `()` on success.

(&self, path: &str)

Source from the content-addressed store, hash-verified

218
219 /// DELETE request, returns `()` on success.
220 pub async fn delete(&self, path: &str) -> Result<(), RemoteError> {
221 let url = format!("{}{}", self.base_url, path);
222 log::debug!("DELETE {}", url);
223
224 let resp = self
225 .http
226 .delete(&url)
227 .send()
228 .await
229 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
230
231 crate::check_min_version_header(resp.headers());
232 let status = resp.status();
233 if status.is_success() {
234 Ok(())
235 } else {
236 let body = resp.text().await.unwrap_or_default();
237 Err(self.parse_error_body(status.as_u16(), &body))
238 }
239 }
240
241 /// Handle a response: check status, parse `ApiResponse<T>`, unwrap data.
242 async fn handle_response<T: DeserializeOwned>(

Callers 4

delete_workspaceMethod · 0.45
delete_projectMethod · 0.45
retire_agentMethod · 0.45
clear_agent_epochMethod · 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