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

Method post

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

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

(
        &self,
        path: &str,
        body: &B,
    )

Source from the content-addressed store, hash-verified

163
164 /// POST request with JSON body, unwrap `ApiResponse` envelope.
165 pub async fn post<B: Serialize, T: DeserializeOwned>(
166 &self,
167 path: &str,
168 body: &B,
169 ) -> Result<T, RemoteError> {
170 let url = format!("{}{}", self.base_url, path);
171 log::debug!("POST {}", url);
172
173 let resp = self
174 .http
175 .post(&url)
176 .json(body)
177 .send()
178 .await
179 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
180
181 self.handle_response(resp).await
182 }
183
184 /// POST with no request body, unwrap `ApiResponse` envelope.
185 pub async fn post_empty<T: DeserializeOwned>(&self, path: &str) -> Result<T, RemoteError> {

Callers 15

executeMethod · 0.80
add_memberFunction · 0.80
add_team_memberFunction · 0.80
claim_domainFunction · 0.80
create_teamFunction · 0.80
add_org_grantFunction · 0.80
add_workspace_grantFunction · 0.80
create_orgFunction · 0.80
post_emptyMethod · 0.80
create_workspaceMethod · 0.80
create_projectMethod · 0.80
enroll_agentMethod · 0.80

Calls 2

handle_responseMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected