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

Method post

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

106
107 /// POST request with JSON body, unwrap `ApiResponse` envelope.
108 pub async fn post<B: Serialize, T: DeserializeOwned>(
109 &self,
110 path: &str,
111 body: &B,
112 ) -> Result<T, RemoteError> {
113 let url = format!("{}{}", self.base_url, path);
114 log::debug!("POST {}", url);
115
116 let resp = self
117 .http
118 .post(&url)
119 .json(body)
120 .send()
121 .await
122 .map_err(|e| RemoteError::other(format!("request failed: {}", e)))?;
123
124 self.handle_response(resp).await
125 }
126
127 /// POST with no request body, unwrap `ApiResponse` envelope.
128 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 1

handle_responseMethod · 0.80

Tested by

no test coverage detected