Update
This commit is contained in:
parent
0ad1739d4f
commit
21009ada78
1 changed files with 0 additions and 37 deletions
37
src/lib.rs
37
src/lib.rs
|
@ -732,41 +732,4 @@ impl Client {
|
||||||
|
|
||||||
Ok(resp.data.elements)
|
Ok(resp.data.elements)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn students(&self) -> Result<()> {
|
|
||||||
let resp = reqwest::Client::new()
|
|
||||||
.get(self.rpc_url.as_str())
|
|
||||||
.header(reqwest::header::USER_AGENT, &self.user_agent)
|
|
||||||
.header(reqwest::header::CONTENT_TYPE, "application/json")
|
|
||||||
.header(reqwest::header::ACCEPT, "application/json")
|
|
||||||
.header(
|
|
||||||
reqwest::header::COOKIE,
|
|
||||||
self.session.as_ref().context("Not logged in")?,
|
|
||||||
)
|
|
||||||
.json(&json!({
|
|
||||||
"id": "ID",
|
|
||||||
"method": "getStudents",
|
|
||||||
"params": {},
|
|
||||||
"jsonrpc": "2.0"
|
|
||||||
}))
|
|
||||||
.send()
|
|
||||||
.await?;
|
|
||||||
// .json()
|
|
||||||
// .await?;
|
|
||||||
// if let Some(e) = resp.error {
|
|
||||||
// bail!("RPC error: {:?}", e);
|
|
||||||
// }
|
|
||||||
dbg!(resp.text().await?);
|
|
||||||
|
|
||||||
// if let Some(x) = resp.result {
|
|
||||||
// Ok(x)
|
|
||||||
// } else {
|
|
||||||
// bail!("RPC result is null");
|
|
||||||
// }
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
// pub async fn exams(&self) -> Result<()> {
|
|
||||||
// Ok(())
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue