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

27
src/notify_read.rs Normal file
View File

@ -0,0 +1,27 @@
extern crate reqwest;
use crate::data_refresh;
use crate::url;
use serde_json::json;
pub async fn post_request(time: String) -> String {
let token = data_refresh(&"access");
let url = url(&"notify_update");
let post = Some(json!({
"seenAt": time.to_string(),
}));
let client = reqwest::Client::new();
let res = client
.post(url)
.json(&post)
.header("Authorization", "Bearer ".to_owned() + &token)
.send()
.await
.unwrap()
.text()
.await
.unwrap();
return res;
}