29 lines
815 B
Rust
29 lines
815 B
Rust
use geoffrey_models::models::parameters::EmptyRequest;
|
|
use hyper::body::{Body, HttpBody};
|
|
use hyper::Client;
|
|
use hyper::{Method, Request};
|
|
use hyperlocal::{UnixClientExt, Uri};
|
|
use tokio::io::{stdout, AsyncWriteExt as _};
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let client = Client::unix();
|
|
|
|
let uri: hyper::Uri = Uri::new("/tmp/geoffrey.socket", "/model/settings/").into();
|
|
|
|
let params = EmptyRequest {};
|
|
|
|
let req = Request::builder()
|
|
.method(Method::GET)
|
|
.uri(uri)
|
|
.header("content-type", "application/json")
|
|
.body(Body::from(serde_json::to_string(¶ms).unwrap()))
|
|
.unwrap();
|
|
|
|
let mut resp = client.request(req).await.unwrap();
|
|
|
|
while let Some(chunk) = resp.body_mut().data().await {
|
|
stdout().write_all(&chunk.unwrap()).await.unwrap();
|
|
}
|
|
}
|