gh_stack/api/
mod.rs

1use crate::Credentials;
2use reqwest::{Client, RequestBuilder};
3use std::time::Duration;
4
5pub mod pull_request;
6pub mod search;
7
8fn base_request(client: &Client, credentials: &Credentials, url: &str) -> RequestBuilder {
9    client
10        .get(url)
11        .timeout(Duration::from_secs(5))
12        .header("Authorization", format!("token {}", credentials.token))
13        .header("User-Agent", "timothyandrew/gh-stack")
14}
15
16fn base_patch_request(client: &Client, credentials: &Credentials, url: &str) -> RequestBuilder {
17    client
18        .patch(url)
19        .timeout(Duration::from_secs(5))
20        .header("Authorization", format!("token {}", credentials.token))
21        .header("User-Agent", "timothyandrew/gh-stack")
22}