Update
This commit is contained in:
parent
45feb2c5a5
commit
b3b194cb7c
2 changed files with 11 additions and 4 deletions
|
@ -15,6 +15,7 @@ publish = false
|
|||
anyhow = { version = "1.0.66", features = ["backtrace"] }
|
||||
chrono = { version = "0.4.23", features = ["serde"] }
|
||||
cookie = "0.16.1"
|
||||
csv = "1.1.6"
|
||||
reqwest = { version = "0.11.13", features = ["json"] }
|
||||
serde = { version = "1.0.150", features = ["derive"] }
|
||||
serde_json = "1.0.89"
|
||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -783,9 +783,8 @@ impl Client {
|
|||
bail!("Report not finished");
|
||||
}
|
||||
|
||||
let mut records_url = self
|
||||
.webuntis_url
|
||||
.join(&format!("reports.do?{}", resp.data.report_params))?;
|
||||
let mut records_url = self.webuntis_url.join("reports.do")?;
|
||||
records_url.set_query(Some(&resp.data.report_params));
|
||||
dbg!(&records_url);
|
||||
records_url
|
||||
.query_pairs_mut()
|
||||
|
@ -807,7 +806,14 @@ impl Client {
|
|||
.await?
|
||||
.text()
|
||||
.await?;
|
||||
dbg!(records);
|
||||
|
||||
let mut reader = csv::ReaderBuilder::new()
|
||||
.delimiter(b'\t')
|
||||
.from_reader(records.as_bytes());
|
||||
for record in reader.records() {
|
||||
let record = record?;
|
||||
dbg!(record);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue