deepstore_server_client/
lib.rs1include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
5
6impl Client {
7 pub fn new_authenticated(base_url: &str, token: &str, timeout: std::time::Duration) -> Self {
9 let mut headers = reqwest::header::HeaderMap::new();
10 headers.insert(
11 reqwest::header::AUTHORIZATION,
12 reqwest::header::HeaderValue::from_str(&format!("Bearer {}", token))
13 .expect("Invalid authorization token"),
14 );
15 let http_client = reqwest::Client::builder()
16 .default_headers(headers)
17 .timeout(timeout)
18 .build()
19 .expect("Failed to build HTTP client");
20 Self::new_with_client(base_url, http_client)
21 }
22}