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

Method get

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

GET request, unwrap `ApiResponse` envelope.

(&self, path: &str)

Source from the content-addressed store, hash-verified

91
92 /// GET request, unwrap `ApiResponse` envelope.
93 pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> {
94 let url = format!("{}{}", self.base_url, path);
95 log::debug!("GET {}", url);
96
97 let resp = self
98 .http
99 .get(&url)
100 .send()
101 .await
102 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
103
104 self.handle_response(resp).await
105 }
106
107 /// POST request with JSON body, unwrap `ApiResponse` envelope.
108 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