client.rs

 1use futures::AsyncReadExt;
 2use http_client::{AsyncBody, HttpClient};
 3use ureq_client::UreqClient;
 4
 5fn main() {
 6    gpui::App::headless().run(|cx| {
 7        println!("{:?}", std::thread::current().id());
 8        cx.spawn(|cx| async move {
 9            let resp = UreqClient::new(
10                None,
11                "Conrad's bot".to_string(),
12                cx.background_executor().clone(),
13            )
14            .get("http://zed.dev", AsyncBody::empty(), true)
15            .await
16            .unwrap();
17
18            let mut body = String::new();
19            resp.into_body().read_to_string(&mut body).await.unwrap();
20            println!("{}", body);
21        })
22        .detach();
23    })
24}