This commit is contained in:
Valentin Brandl 2022-02-05 14:57:03 +01:00
parent bb56cb8143
commit 97b47f6e11
3 changed files with 317 additions and 742 deletions

1051
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
html5ever = "0.25.1"
reqwest = "0.9.16"
reqwest = { version = "0.11.9", features = ["blocking"] }
serde = "1.0.136"
serde_derive = "1.0.136"
structopt = "0.3.26"

View File

@ -97,7 +97,7 @@ where
}
fn login(loginid: String, password: String) -> Result<bool, Error> {
let mut res = reqwest::get(MASK_URL)?;
let mut res = reqwest::blocking::get(MASK_URL)?;
let opts = ParseOpts {
tree_builder: TreeBuilderOpts {
drop_doctype: true,
@ -117,7 +117,7 @@ fn login(loginid: String, password: String) -> Result<bool, Error> {
ipaddr,
};
let client = reqwest::Client::new();
let client = reqwest::blocking::Client::new();
let mut res = client.post(API_URL).form(&data).send()?;
let dom = parse_document(RcDom::default(), opts)
.from_utf8()
@ -127,7 +127,7 @@ fn login(loginid: String, password: String) -> Result<bool, Error> {
fn logout() -> Result<bool, Error> {
let data = Request::Logout;
let client = reqwest::Client::new();
let client = reqwest::blocking::Client::new();
let mut res = client.post(API_URL).form(&data).send()?;
let opts = ParseOpts {