Crate oauthcli [] [src]

Yet Another OAuth 1.0 Client Library for Rust

Examples

Basic sample:

use oauthcli::*;
let url = url::Url::parse("http://example.com/").unwrap();
let header =
    OAuthAuthorizationHeaderBuilder::new(
        "GET", &url, "consumer", "secret", SignatureMethod::HmacSha1)
    .token("token", "secret")
    .finish();

If you use for Twitter, because of Twitter's bug, use finish_for_twitter method, and make sure to encode the request body with OAUTH_ENCODE_SET. For more detail, see this article (Japanese).

Structs

OAUTH_ENCODE_SET

RFC 5849 section 3.6.

OAuthAuthorizationHeader

Authorization header for OAuth.

OAuthAuthorizationHeaderBuilder

Enums

ParseOAuthAuthorizationHeaderError
SignatureMethod

Available oauth_signature_method types.

Functions

authorization_header [
Deprecated
]

Generate Authorization header for OAuth. The return value starts with "OAuth ".

nonce

Generate a string for oauth_nonce.

timestamp [
Deprecated
]

Generate a string for oauth_timestamp.