add fn downlaod_page
This commit is contained in:
@@ -24,7 +24,7 @@ impl Command for CommandDownload {
|
||||
// println!("{:?}", har);
|
||||
|
||||
har.log.entries.iter().for_each(|e| {
|
||||
println!("{:<100} {}", e.request.url, e.server_ip_address);
|
||||
println!("{:<100} {:?}", e.request.url, /*e.server_ip_address,*/ e.pageref);
|
||||
});
|
||||
|
||||
Ok(())
|
||||
|
||||
17
src/har.rs
17
src/har.rs
@@ -93,4 +93,21 @@ pub struct HarLog {
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Har {
|
||||
pub log: HarLog,
|
||||
}
|
||||
|
||||
// TODO
|
||||
pub fn downlaod_page(har: &Har, har_page: &HarPage) {
|
||||
let page_id = &har_page.id;
|
||||
har.log.entries.iter().filter(|e| if let Some(pageref) = &e.pageref {
|
||||
pageref == page_id
|
||||
} else {
|
||||
false
|
||||
}).for_each(|e| {
|
||||
make_request(&e.request);
|
||||
});
|
||||
}
|
||||
|
||||
// GET, POST
|
||||
pub fn make_request(har_request: &HarRequest) -> Option<()> { // ???
|
||||
None
|
||||
}
|
||||
Reference in New Issue
Block a user