diff --git a/src/external.rs b/src/external.rs index d680a6b..fc11831 100644 --- a/src/external.rs +++ b/src/external.rs @@ -8,7 +8,12 @@ pub async fn post_api, B: AsRef>( endpoint: B, mapjson: HashMap, ) -> Result> { - let client = reqwest::Client::new(); + static APP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); + + let client = reqwest::Client::builder() + .user_agent(APP_USER_AGENT) + .build()?; + let res = client .post(format!("{}{}", server.as_ref(), endpoint.as_ref())) .json(&mapjson)