[−][src]Struct reqwest_oauth1::OAuthParameters
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
impl<'_> OAuthParameters<'_, HmacSha1>
[src]
impl<'a, TSM> OAuthParameters<'a, TSM> where
TSM: SignatureMethod + Clone,
[src]
TSM: SignatureMethod + Clone,
pub fn callback<T>(self, callback: T) -> Self where
T: Into<Cow<'a, str>>,
[src]
T: Into<Cow<'a, str>>,
set the oauth_callback value
pub fn nonce<T>(self, nonce: T) -> Self where
T: Into<Cow<'a, str>>,
[src]
T: Into<Cow<'a, str>>,
set the oauth_nonce value
pub fn realm<T>(self, realm: T) -> Self where
T: Into<Cow<'a, str>>,
[src]
T: Into<Cow<'a, str>>,
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
pub fn timestamp<T>(self, timestamp: T) -> Self where
T: Into<u64>,
[src]
T: Into<u64>,
set the oauth_timestamp value
pub fn verifier<T>(self, verifier: T) -> Self where
T: Into<Cow<'a, str>>,
[src]
T: Into<Cow<'a, str>>,
set the oauth_verifier value
pub fn version<T>(self, version: T) -> Self where
T: Into<bool>,
[src]
T: Into<bool>,
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.
pub fn signature_method<T>(self, signature_method: T) -> OAuthParameters<'a, T> where
T: SignatureMethod + Clone,
[src]
T: SignatureMethod + Clone,
Trait Implementations
impl<'a, TSM: Clone> Clone for OAuthParameters<'a, TSM> where
TSM: SignatureMethod + Clone,
[src]
TSM: SignatureMethod + Clone,
fn clone(&self) -> OAuthParameters<'a, TSM>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, TSM: Debug> Debug for OAuthParameters<'a, TSM> where
TSM: SignatureMethod + Clone,
[src]
TSM: SignatureMethod + Clone,
impl Default for OAuthParameters<'static, HmacSha1>
[src]
Auto Trait Implementations
impl<'a, TSM> RefUnwindSafe for OAuthParameters<'a, TSM> where
TSM: RefUnwindSafe,
TSM: RefUnwindSafe,
impl<'a, TSM> Send for OAuthParameters<'a, TSM> where
TSM: Send,
TSM: Send,
impl<'a, TSM> Sync for OAuthParameters<'a, TSM> where
TSM: Sync,
TSM: Sync,
impl<'a, TSM> Unpin for OAuthParameters<'a, TSM> where
TSM: Unpin,
TSM: Unpin,
impl<'a, TSM> UnwindSafe for OAuthParameters<'a, TSM> where
TSM: UnwindSafe,
TSM: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,