Skip to main content

winprint_kit/
http.rs

1//! Shared [`reqwest::Client`] HTTP client.
2
3use std::sync::OnceLock;
4use std::time::Duration;
5
6static CLIENT: OnceLock<reqwest::Client> = OnceLock::new();
7
8pub fn client() -> &'static reqwest::Client {
9    CLIENT.get_or_init(|| {
10        reqwest::Client::builder()
11            .timeout(Duration::from_secs(30))
12            .build()
13            .unwrap_or_default()
14    })
15}