use crate::proc::Command;

pub fn read_json_as_string(url: &str) -> anyhow::Result<String> {
    let mut cmd = Command::new("curl");
    cmd.args(["-H", "Accept: application/json", url]);
    cmd.try_spawn_to_string()
}

pub fn read_text_as_string(url: &str) -> anyhow::Result<String> {
    let mut cmd = Command::new("curl");
    cmd.arg(url);
    cmd.try_spawn_to_string()
}
