MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / get_data

Function get_data

ChatGPT/src-tauri/src/utils.rs:137–154  ·  view source on GitHub ↗
(
  url: &str,
  app: Option<&tauri::AppHandle>,
)

Source from the content-addressed store, hash-verified

135}
136
137pub async fn get_data(
138 url: &str,
139 app: Option<&tauri::AppHandle>,
140) -> Result<Option<String>, reqwest::Error> {
141 let res = reqwest::get(url).await?;
142 let is_ok = res.status() == 200;
143 let body = res.text().await?;
144
145 if is_ok {
146 Ok(Some(body))
147 } else {
148 error!("chatgpt_http: {}", body);
149 if let Some(v) = app {
150 tauri::api::dialog::message(v.get_window("core").as_ref(), "ChatGPT HTTP", body);
151 }
152 Ok(None)
153 }
154}
155
156pub fn run_check_update(app: AppHandle<Wry>, silent: bool, has_msg: Option<bool>) {
157 info!("run_check_update: silent={} has_msg={:?}", silent, has_msg);

Callers

nothing calls this directly

Calls 1

messageFunction · 0.85

Tested by

no test coverage detected