cartulary 0.3.0-alpha.1

The knowledge layer of your project — decisions, issues, docs, all in one place.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Port: HTTP GET requests for the GitLab adapter.
///
/// Implementations: `UreqClient` (production), `StubClient` (tests).
pub trait HttpClient {
    /// Perform a GET request and return the response body as a string.
    ///
    /// `url` is the full URL including query parameters.
    /// `headers` is a list of `(name, value)` pairs (e.g. `("PRIVATE-TOKEN", "xxx")`).
    fn get(&self, url: &str, headers: &[(&str, &str)]) -> anyhow::Result<HttpResponse>;
}

/// A simplified HTTP response.
pub struct HttpResponse {
    pub status: u16,
    pub body: String,
}