use mattermost_api
This commit is contained in:
parent
76772e53f3
commit
9b3aeaf6ac
1 changed files with 8 additions and 10 deletions
|
@ -1,13 +1,11 @@
|
||||||
|
use mattermost_api::prelude::*;
|
||||||
|
|
||||||
/// Se connecte à Mattermost depuis Gitlab
|
/// Se connecte à Mattermost depuis Gitlab
|
||||||
#[tokio::main]
|
pub async fn connexion(token: &str) {
|
||||||
pub async fn connexion() -> Result<reqwest::Response, reqwest::Error> {
|
let auth = AuthenticationData::from_access_token(&token);
|
||||||
let client = reqwest::Client::new();
|
let mut api = Mattermost::new("https://talk.up8.edu", auth);
|
||||||
|
api.store_session_token().await.unwrap();
|
||||||
|
let team_info = api.get_team_info("etudiant-es").await.unwrap();
|
||||||
|
|
||||||
let params = [("foo", "bar"), ("baz", "quux")];
|
println!("{:?}", team_info);
|
||||||
let res = client.post("http://httpbin.org/post")
|
|
||||||
.form(¶ms)
|
|
||||||
.send()
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(res)
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue