Skip to main content

mecha10_cli_core/utils/
http_client.rs

1//! Shared HTTP client construction for CLI-side services that talk to
2//! mecha10-api or other HTTP endpoints (binary downloads, template
3//! downloads, etc). Centralized so the user agent stays consistent and
4//! callers don't each hand-roll an identical `reqwest::Client::builder()`.
5
6use anyhow::{Context, Result};
7
8/// Build a `reqwest::Client` configured with the standard mecha10-cli user agent.
9pub fn build_client() -> Result<reqwest::Client> {
10    reqwest::Client::builder()
11        .user_agent("mecha10-cli")
12        .build()
13        .context("Failed to build HTTP client")
14}