cellstate/
http.rs

1//! Shared HTTP client helpers used by multiple CLI commands.
2
3use std::time::Duration;
4
5/// Default base URL for a local CELLSTATE dev server.
6pub const DEFAULT_BASE_URL: &str = "http://localhost:3000";
7
8/// Build a [`reqwest::blocking::Client`] with the given timeout in seconds.
9pub fn default_http_client(timeout_secs: u64) -> anyhow::Result<reqwest::blocking::Client> {
10    reqwest::blocking::Client::builder()
11        .timeout(Duration::from_secs(timeout_secs))
12        .build()
13        .map_err(Into::into)
14}