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

Method put

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

141
142 /// PUT request with JSON body, unwrap `ApiResponse` envelope.
143 pub async fn put<B: Serialize, T: DeserializeOwned>(
144 &self,
145 path: &str,
146 body: &B,
147 ) -> Result<T, RemoteError> {
148 let url = format!("{}{}", self.base_url, path);
149 log::debug!("PUT {}", url);
150
151 let resp = self
152 .http
153 .put(&url)
154 .json(body)
155 .send()
156 .await
157 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
158
159 self.handle_response(resp).await
160 }
161
162 /// DELETE request, returns `()` on success.
163 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 1

handle_responseMethod · 0.80

Tested by

no test coverage detected