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

Method put

atomic-remote/src/storage.rs:168–185  ·  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

166
167 /// PUT request with JSON body, unwrap `ApiResponse` envelope.
168 pub async fn put<B: Serialize, T: DeserializeOwned>(
169 &self,
170 path: &str,
171 body: &B,
172 ) -> Result<T, RemoteError> {
173 let url = format!("{}{}", self.base_url, path);
174 log::debug!("PUT {}", url);
175
176 let resp = self
177 .http
178 .put(&url)
179 .json(body)
180 .send()
181 .await
182 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
183
184 self.handle_response(resp).await
185 }
186
187 /// DELETE request, returns `()` on success.
188 pub async fn delete(&self, path: &str) -> Result<(), RemoteError> {

Callers 6

update_member_roleFunction · 0.80
update_team_member_roleFunction · 0.80
update_teamFunction · 0.80
update_orgFunction · 0.80
update_workspaceMethod · 0.80
update_projectMethod · 0.80

Calls 2

handle_responseMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected