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

Method put

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

PUT request with JSON body, unwrap `ApiResponse` envelope.

(
        &self,
        path: &str,
        body: &B,
    )

Source from the content-addressed store, hash-verified

198
199 /// PUT request with JSON body, unwrap `ApiResponse` envelope.
200 pub async fn put<B: Serialize, T: DeserializeOwned>(
201 &self,
202 path: &str,
203 body: &B,
204 ) -> Result<T, RemoteError> {
205 let url = format!("{}{}", self.base_url, path);
206 log::debug!("PUT {}", url);
207
208 let resp = self
209 .http
210 .put(&url)
211 .json(body)
212 .send()
213 .await
214 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
215
216 self.handle_response(resp).await
217 }
218
219 /// DELETE request, returns `()` on success.
220 pub async fn delete(&self, path: &str) -> Result<(), RemoteError> {

Callers 6

update_member_roleFunction · 0.45
update_team_member_roleFunction · 0.45
update_teamFunction · 0.45
update_orgFunction · 0.45
update_workspaceMethod · 0.45
update_projectMethod · 0.45

Calls 2

handle_responseMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected