MCPcopy Create free account
hub / github.com/Botloader/botloader / get

Method get

cmd/blcmd/src/api_client.rs:19–35  ·  view source on GitHub ↗
(&self, path: &str)

Source from the content-addressed store, hash-verified

17 }
18
19 pub async fn get<T: DeserializeOwned>(&self, path: &str) -> anyhow::Result<T> {
20 let req = self
21 .client
22 .request(reqwest::Method::GET, format!("{}/{}", self.base_url, path))
23 .header("Authorization", &self.token);
24
25 let resp = req.send().await?;
26 if !resp.status().is_success() {
27 let status = resp.status();
28 let body = resp.text().await?;
29 return Err(anyhow::anyhow!(
30 "API request failed: status {status}, body: {body}",
31 ));
32 }
33
34 Ok(resp.json().await?)
35 }
36
37 pub async fn get_self_user(&self) -> anyhow::Result<CurrentUser> {
38 self.get("api/current_user").await

Callers 15

http.tsFile · 0.45
attachment.tsFile · 0.45
roles.tsFile · 0.45
invites.tsFile · 0.45
storage_var.tsFile · 0.45
testJsonFunction · 0.45
testNumberFunction · 0.45
threads_events.tsFile · 0.45
interval2.tsFile · 0.45
get_self_userMethod · 0.45
tags.tsFile · 0.45
welcome.tsFile · 0.45

Calls 5

requestMethod · 0.80
textMethod · 0.80
jsonMethod · 0.65
sendMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected