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

Method delete

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

DELETE request, returns `()` on success.

(&self, path: &str)

Source from the content-addressed store, hash-verified

161
162 /// DELETE request, returns `()` on success.
163 pub async fn delete(&self, path: &str) -> Result<(), RemoteError> {
164 let url = format!("{}{}", self.base_url, path);
165 log::debug!("DELETE {}", url);
166
167 let resp = self
168 .http
169 .delete(&url)
170 .send()
171 .await
172 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
173
174 crate::check_min_version_header(resp.headers());
175 let status = resp.status();
176 if status.is_success() {
177 Ok(())
178 } else {
179 let body = resp.text().await.unwrap_or_default();
180 Err(self.parse_error_body(status.as_u16(), &body))
181 }
182 }
183
184 /// Handle a response: check status, parse `ApiResponse<T>`, unwrap data.
185 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