pub trait HttpClient: Send + Sync {
// Required methods
fn get(
&self,
url: &str,
params: &[(&str, &str)],
) -> Pin<Box<dyn Future<Output = Result<Response, QobuzApiError>> + Send + '_>>;
fn post_form(
&self,
url: &str,
params: &[(&str, &str)],
) -> Pin<Box<dyn Future<Output = Result<Response, QobuzApiError>> + Send + '_>>;
fn get_with_auth(
&self,
url: &str,
token: &str,
range: Option<&str>,
) -> Pin<Box<dyn Future<Output = Result<Response, QobuzApiError>> + Send + '_>>;
}Expand description
HTTP client trait enabling deterministic testing via mock implementations.
Uses boxed futures instead of async fn to remain object-safe for dyn dispatch.