Struct oauth1_request::Request
source · Expand description
A pair of an OAuth header and its corresponding query/form string.
Fields
The Authorization
header string for the request.
data: String
The URI with query string or the x-www-form-urlencoded string for the request.
Implementations
sourceimpl Request
impl Request
sourcepub 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
👎Deprecated since 0.2.1: Use <Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>> as OAuth1Authorize>::authorize
instead
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
<Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>> as OAuth1Authorize>::authorize
insteadConvenience 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()),
);
sourcepub 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
👎Deprecated since 0.2.1: Use <Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>> as OAuth1Authorize>::authorize_form
instead
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
<Option<&BTreeSet<(impl Borrow<str>, impl Borrow<str>)>> as OAuth1Authorize>::authorize_form
insteadConvenience 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()),
);
Trait Implementations
impl Eq for Request
impl StructuralEq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more