use super::HttpClientError;
use async_trait::async_trait;
use http::{HeaderMap, StatusCode};
use url::Url;

/// A bare HTTP client.
#[async_trait]
pub trait BareHttpClient: Send + Sync {
    /// Sends a GET request.
    async fn get(&self, request: &BareRequest) -> Result<BareResponse, HttpClientError>;
}

#[derive(Clone, Debug)]
pub struct BareRequest {
    pub url: Url,
    pub headers: HeaderMap,
}

#[derive(Debug)]
#[cfg_attr(test, derive(Clone))]
pub struct BareResponse {
    pub url: Url,
    pub status: StatusCode,
    pub headers: HeaderMap,
    pub body: Vec<u8>,
}
