This commit is contained in:
2023-10-20 23:31:16 +09:00
parent 430b5977d8
commit e712a5adcb
49 changed files with 3300 additions and 1 deletions

28
src/refresh.rs Normal file
View File

@ -0,0 +1,28 @@
extern crate reqwest;
use crate::data_toml;
use crate::url;
pub async fn post_request() -> String {
let refresh = data_toml(&"refresh");
let url = url(&"session_refresh");
let client = reqwest::Client::new();
let res = client
.post(url)
.header("Authorization", "Bearer ".to_owned() + &refresh)
.send()
.await
.unwrap();
let status_ref = res.error_for_status_ref();
match status_ref {
Ok(_) => {
return res.text().await.unwrap();
}
Err(_e) => {
let e = "err".to_string();
return e;
}
}
}