File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 71
71
//! );
72
72
//! ```
73
73
//!
74
+ //! See [`Request`][oauth1_request_derive::Request] for more details on the derive macro.
75
+ //!
76
+ //! If you want to authorize a request with dynamic keys, you can use a
77
+ //! [`BTreeSet<(K, V)>`][std::collections::BTreeSet]:
78
+ //!
79
+ //! ```
80
+ //! # extern crate oauth1_request as oauth;
81
+ //! #
82
+ //! use std::collections::BTreeSet;
83
+ //!
84
+ //! let request: BTreeSet<_> = vec![
85
+ //! ("article_id", "123456789"),
86
+ //! ("text", "A request signed with OAuth & Rust 🦀 🔏"),
87
+ //! ]
88
+ //! .into_iter()
89
+ //! .collect();
90
+ //!
91
+ //! let form = oauth::to_form_urlencoded(&request);
92
+ //! assert_eq!(
93
+ //! form,
94
+ //! "article_id=123456789&text=A%20request%20signed%20with%20OAuth%20%26%20Rust%20%F0%9F%A6%80%20%F0%9F%94%8F",
95
+ //! );
96
+ //! ```
97
+ //!
74
98
//! Use [`oauth::Builder`][Builder] if you need to specify a callback URI or verifier:
75
99
//!
76
- //! ```rust
100
+ //! ```
77
101
//! # extern crate oauth1_request as oauth;
78
102
//! #
79
103
//! let uri = "https://example.com/oauth/request_temp_credentials";
85
109
//! .callback(callback)
86
110
//! .post(uri, &());
87
111
//! ```
88
- //!
89
- //! See [`Request`][oauth1_request_derive::Request] for more details on the derive macro.
90
112
91
113
#![ cfg_attr( docsrs, feature( doc_cfg, doc_cfg_hide) ) ]
92
114
#![ doc( html_root_url = "https://docs.rs/oauth1-request/0.5.1" ) ]
You can’t perform that action at this time.
0 commit comments