(con: &Connection)
| 34 | } |
| 35 | |
| 36 | pub fn build_client(con: &Connection) -> Client { |
| 37 | let mut builder = Client::builder().user_agent(APP_USER_AGENT); |
| 38 | |
| 39 | if let Some(auth_header) = con.auth_header.to_header() { |
| 40 | let headers = http::HeaderMap::from_iter([(header::AUTHORIZATION, auth_header)]); |
| 41 | |
| 42 | builder = builder.default_headers(headers); |
| 43 | } |
| 44 | |
| 45 | builder.build().unwrap() |
| 46 | } |
| 47 | |
| 48 | pub struct ClientApi { |
| 49 | pub con: Connection, |