Basic OAuth1 library for Rust.
extern crate oauth1;
extern crate reqwest;
use oauth1::Token;
use reqwest::Client;
use reqwest::header::Authorization;
pub fn main() {
let client = Client::new();
let url = "https://api.twitter.com/1.1/account/verify_credentials.json";
let res = client.get(url)
.header(Authorization(oauth1::authorize(
"GET",
url,
&Token::new("consumer_key", "consumer_secret"),
Some(&Token::new("auth_token", "auth_token_secret")),
None,
)))
.send().unwrap();
}
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.