pub async fn get_client(mut headers: HeaderMap) -> Result<Client, Box<dyn std::error::Error + Send>> {
// We would like json
headers.insert(
"Content-Type",
HeaderValue::from_str("appication/json")
.map_err(|e| -> Box<dyn std::error::Error + Send> { Box::new(e) })?,
);
// Create client
let client: Client = Client::builder()
.user_agent("TargetR")
.timeout(std::time::Duration::new(90, 0))
//.gzip(true)
.default_headers(headers)
.build()
.map_err(|e| -> Box<dyn std::error::Error + Send> { Box::new(e) })?;
Ok(client)
}