Skip to content

mehcode/oauth1-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuth1

Basic OAuth1 library for Rust.

Usage

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();
}

License

Licensed under either of

at your option.

Contribution

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.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages