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

Method post_empty

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

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

(&self, path: &str)

Source from the content-addressed store, hash-verified

126
127 /// POST with no request body, unwrap `ApiResponse` envelope.
128 pub async fn post_empty<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> {
129 let url = format!("{}{}", self.base_url, path);
130 log::debug!("POST {} (no body)", url);
131
132 let resp = self
133 .http
134 .post(&url)
135 .send()
136 .await
137 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
138
139 self.handle_response(resp).await
140 }
141
142 /// PUT request with JSON body, unwrap `ApiResponse` envelope.
143 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