This commit is contained in:
Dominic Grimm 2023-01-27 18:55:44 +01:00
parent e4b5af4d64
commit 45feb2c5a5
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530

View file

@ -783,6 +783,32 @@ impl Client {
bail!("Report not finished");
}
let mut records_url = self
.webuntis_url
.join(&format!("reports.do?{}", resp.data.report_params))?;
dbg!(&records_url);
records_url
.query_pairs_mut()
.append_pair("msgId", &resp.data.message_id.to_string());
dbg!(&records_url);
let records = reqwest::Client::new()
.get(records_url)
.header(reqwest::header::USER_AGENT, &self.user_agent)
.header(reqwest::header::ACCEPT, "text/csv")
.header(
reqwest::header::COOKIE,
self.session.as_ref().context("Not logged in")?,
)
.header(
reqwest::header::AUTHORIZATION,
Client::construct_bearer(&self.authorization.as_ref().context("Not logged in")?),
)
.send()
.await?
.text()
.await?;
dbg!(records);
Ok(())
}
}