pub struct OAuthParameters<'a, TSM> where
    TSM: SignatureMethod + Clone
{ /* private fields */ }
Expand description

Represents OAuth parameters including oauth_nonce, oauth_timestamp, realm, and others.

Basic usage

use reqwest_oauth1::OAuthClientProvider;

let consumer_key = "[CONSUMER_KEY]";
let consumer_secret = "[CONSUMER_SECRET]";
let secrets = reqwest_oauth1::Secrets::new(consumer_key, consumer_secret);

let nonce = "[NONCE]";
let timestamp = 100_000_001u64;
let callback = "http://example.com/ready";

let params = reqwest_oauth1::OAuthParameters::new()
    .nonce(nonce)
    .timestamp(timestamp)
    .callback(callback);

let req = reqwest::Client::new()
    .oauth1_with_params(secrets, params)
    .post("http://example.com/")
    // and so on...
    ;

Note

You can specify same parameters as get/post queries and they will superseded with the specified one in the OAuthParameters.

use reqwest_oauth1::OAuthClientProvider;

let consumer_key = "[CONSUMER_KEY]";
let consumer_secret = "[CONSUMER_SECRET]";
let secrets = reqwest_oauth1::Secrets::new(consumer_key, consumer_secret);

let params = reqwest_oauth1::OAuthParameters::new()
    .nonce("ThisNonceWillBeSuperseded");
let req = reqwest::Client::new()
    .oauth1_with_params(secrets, params)
    .get("http://example.com/")
    .query(&[("nonce", "ThisNonceWillSupersedeTheOldOne")])
    // and so on...
    ;

Implementations

set the oauth_callback value

set the oauth_nonce value

set the realm value

Note

this parameter will not be included in the signature-base string. cf. https://tools.ietf.org/html/rfc5849#section-3.4.1.3.1

set the oauth_timestamp value

set the oauth_verifier value

set the oauth_version value (boolean)

Note

When the version has value true, oauth_version will be set with “1.0”. Otherwise, oauth_version will not be included in your request. In oauth1, oauth_version value must be “1.0” or not specified.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more