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

Method post

atomic-remote/src/storage.rs:133–150  ·  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

131
132 /// POST request with JSON body, unwrap `ApiResponse` envelope.
133 pub async fn post<B: Serialize, T: DeserializeOwned>(
134 &self,
135 path: &str,
136 body: &B,
137 ) -> Result<T, RemoteError> {
138 let url = format!("{}{}", self.base_url, path);
139 log::debug!("POST {}", url);
140
141 let resp = self
142 .http
143 .post(&url)
144 .json(body)
145 .send()
146 .await
147 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
148
149 self.handle_response(resp).await
150 }
151
152 /// POST with no request body, unwrap `ApiResponse` envelope.
153 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
upload_changeMethod · 0.80

Calls 2

handle_responseMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected