For now this is just a simple implementation only supporting `put` steps. `in` is a noop, so `no_get: true` is recommended.
19 lines
482 B
Rust
19 lines
482 B
Rust
use color_eyre::Result;
|
|
use reqwest::blocking::Client;
|
|
use reqwest::header::HeaderMap;
|
|
|
|
use crate::USER_AGENT;
|
|
|
|
pub(crate) fn make_client(access_token: impl AsRef<str>) -> Result<Client> {
|
|
let mut headers = HeaderMap::new();
|
|
headers.insert(
|
|
"Authorization",
|
|
format!("token {}", access_token.as_ref()).try_into()?,
|
|
);
|
|
|
|
Client::builder()
|
|
.default_headers(headers)
|
|
.user_agent(USER_AGENT)
|
|
.build()
|
|
.map_err(From::from)
|
|
}
|