oauth1-request
Yet yet yet another OAuth 1.0 client library for Rust.
Usage
Add this to your Cargo.toml:
[]
= { = "0.6", = "oauth1-request" }
A typical authorization flow looks like this:
// Define a type to represent your request.
let uri = "https://example.com/api/v1/comments/create.json";
let request = CreateComment ;
// Prepare your credentials.
let token =
from_parts;
// Create the `Authorization` header.
let authorization_header = post;
// `oauth_nonce` and `oauth_timestamp` vary on each execution.
assert_eq!;
// You can create an `x-www-form-urlencoded` string or a URI with query pairs from the request.
let form = to_form;
assert_eq!;
let uri = to_query;
assert_eq!;