summaryrefslogtreecommitdiff
path: root/src/strava.rs
blob: 490964b722a3ce806f7af079415e2d1d25ebdaef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use reqwest;

pub fn exchange_token(
    client_id: &str,
    client_secret: &str,
    code: &str) {
    let client = reqwest::blocking::Client::new();
    let params = [("client_id", client_id),
                  ("client_secret", client_secret),
                  ("code", code)];
    let uri = "https://www.strava.com/oauth/token";
    let req = client.post(uri).form(&params);
    let mut res = req.send().unwrap().text();
    println!("{:?}", res);
}