Add missing file

This commit is contained in:
Dennis 2024-06-13 12:22:57 +02:00
parent 77477a86dd
commit edffbae777
No known key found for this signature in database
GPG Key ID: 6937EAEA33A3FA5D

View File

@ -0,0 +1,24 @@
// struct to keep state agent, profile, host, etc
// functions to make nearest, route, etc calls
// fn nearest(arg1, ... argn) -> NearestResponse
use std::{path::Path, time::Duration};
use ureq::{Agent, AgentBuilder};
pub struct HttpRequest {
agent: Agent,
}
impl HttpRequest {
// pub fn fetch_to_file(url: &str, output: &Path) -> Result<()> {}
pub fn new() -> Self {
let agent = AgentBuilder::new()
.timeout_read(Duration::from_secs(5))
.timeout_write(Duration::from_secs(5))
.build();
Self { agent }
}
}