mecha10-cli-core 0.7.0

Mecha10 CLI core foundation — shared types, services, and utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Shared HTTP client construction for CLI-side services that talk to
//! mecha10-api or other HTTP endpoints (binary downloads, template
//! downloads, etc). Centralized so the user agent stays consistent and
//! callers don't each hand-roll an identical `reqwest::Client::builder()`.

use anyhow::{Context, Result};

/// Build a `reqwest::Client` configured with the standard mecha10-cli user agent.
pub fn build_client() -> Result<reqwest::Client> {
    reqwest::Client::builder()
        .user_agent("mecha10-cli")
        .build()
        .context("Failed to build HTTP client")
}