[][src]Struct oauth1_request::Request

pub struct Request {
    pub authorization: String,
    pub data: String,
}

A pair of an OAuth header and its corresponding query/form string.

Fields

authorization: String

The Authorization header string for the request.

data: String

The URI with query string or the x-www-form-urlencoded string for the request.

Methods

impl Request[src]

pub fn new<'a, SM: SignatureMethod>(
    method: &str,
    uri: impl Display,
    consumer_key: &str,
    consumer_secret: &str,
    token_secret: impl Into<Option<&'a str>>,
    signature_method: SM,
    options: impl Into<Option<&'a Options<'a>>>,
    params: Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>>
) -> Self
[src]

Deprecated since 0.2.1:

Use <Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>> as OAuth1Authorize>::authorize instead

Convenience method for creating a Request using Signer::new.

Example

extern crate oauth1_request as oauth;

let oauth::Request { authorization, data } = oauth::Request::new(
    "GET",
    "https://example.com/api/v1/get.json",
    "consumer_key",
    "consumer_secret",
    "token_secret",
    oauth::HmacSha1,
    &*oauth::Options::new().token("token"),
    Some(&[("key", "value")].iter().cloned().collect()),
);

pub fn new_form<'a, SM: SignatureMethod>(
    method: &str,
    uri: impl Display,
    consumer_key: &str,
    consumer_secret: &str,
    token_secret: impl Into<Option<&'a str>>,
    signature_method: SM,
    options: impl Into<Option<&'a Options<'a>>>,
    params: Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>>
) -> Self
[src]

Deprecated since 0.2.1:

Use <Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>> as OAuth1Authorize>::authorize_form instead

Convenience method for creating a Request using Signer::new_form.

Example

extern crate oauth1_request as oauth;

let oauth::Request { authorization, data } = oauth::Request::new(
    "POST",
    "https://example.com/api/v1/post.json",
    "consumer_key",
    "consumer_secret",
    "token_secret",
    oauth::HmacSha1,
    &*oauth::Options::new().token("token"),
    Some(&[("key", "value")].iter().cloned().collect()),
);

pub fn signer<'a, SM: SignatureMethod>(
    method: &str,
    uri: impl Display,
    consumer_secret: &str,
    token_secret: impl Into<Option<&'a str>>,
    signature_method: SM
) -> Signer<SM, NotReady>
[src]

Alias of Signer::with_signature_method for convenience.

pub fn signer_form<'a, SM: SignatureMethod>(
    method: &str,
    uri: impl Display,
    consumer_secret: &str,
    token_secret: impl Into<Option<&'a str>>,
    signature_method: SM
) -> Signer<SM, NotReady>
[src]

Alias of Signer::form_with_signature_method for convenience.

Trait Implementations

impl Clone for Request[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Request> for Request[src]

impl Eq for Request[src]

impl Hash for Request[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Request[src]

Auto Trait Implementations

impl Send for Request

impl Unpin for Request

impl Sync for Request

impl RefUnwindSafe for Request

impl UnwindSafe for Request

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self