Add missing file
This commit is contained in:
parent
77477a86dd
commit
edffbae777
24
tests/common/http_request.rs
Normal file
24
tests/common/http_request.rs
Normal 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 }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user