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

Method get

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

GET request, unwrap `ApiResponse` envelope.

(&self, path: &str)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

handle_responseMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected