diff --git a/tests/common/http_request.rs b/tests/common/http_request.rs new file mode 100644 index 000000000..8e89ccd71 --- /dev/null +++ b/tests/common/http_request.rs @@ -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 } + } +}