buddy_client 0.0.1

A client for the Prusa Buddy Firmware http api.
Documentation
use dotenvy_macro::dotenv;
use reqwest::Client;

/// An example using purely Reqwest to access the buddy API.
#[tokio::main]
async fn main() {
    let client = Client::new();

    // Get some environment variables.
    let ip = dotenv!("PRUSA_IP");
    let key = dotenv!("PRUSA_KEY");

    let url = format!("http://{}/api/printer", ip);
    println!("{}", url);

    let resp = client.get(url).header("X-API-KEY", key).send().await;
    println!("{:?}", resp);
    println!("{:?}", resp.unwrap().text().await.unwrap());
}