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
|
||||
#[tokio::main]
|
||||
pub async fn connexion() -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
pub async fn connexion(token: &str) {
|
||||
let auth = AuthenticationData::from_access_token(&token);
|
||||
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")];
|
||||
let res = client.post("http://httpbin.org/post")
|
||||
.form(¶ms)
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
Ok(res)
|
||||
println!("{:?}", team_info);
|
||||
}
|
||||
|
|
Reference in a new issue