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

Method post_empty

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

POST with no request body, unwrap `ApiResponse` envelope.

(&self, path: &str)

Source from the content-addressed store, hash-verified

151
152 /// POST with no request body, unwrap `ApiResponse` envelope.
153 pub async fn post_empty<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> {
154 let url = format!("{}{}", self.base_url, path);
155 log::debug!("POST {} (no body)", url);
156
157 let resp = self
158 .http
159 .post(&url)
160 .send()
161 .await
162 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
163
164 self.handle_response(resp).await
165 }
166
167 /// PUT request with JSON body, unwrap `ApiResponse` envelope.
168 pub async fn put<B: Serialize, T: DeserializeOwned>(

Callers 2

verify_domainFunction · 0.80
upgrade_orgFunction · 0.80

Calls 2

postMethod · 0.80
handle_responseMethod · 0.80

Tested by

no test coverage detected