Fixed compatibility for HTTPClient Library. (HTTPClient by Donatien Garnier)
Dependents: FlashAir_Twitter CyaSSL-Twitter-OAuth4Tw TweetTest NetworkThermometer ... more
Fork of OAuth4Tw by
OAuth4Tw.cpp@2:a057c813fb02, 2014-12-15 (annotated)
- Committer:
- ban4jp
- Date:
- Mon Dec 15 12:24:37 2014 +0000
- Revision:
- 2:a057c813fb02
- Parent:
- 0:0048b264a3ad
- Child:
- 3:c28b796ef7ed
remove debug code.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takahashim | 0:0048b264a3ad | 1 | #include "OAuth4Tw.h" |
takahashim | 0:0048b264a3ad | 2 | #include "mbed.h" |
takahashim | 0:0048b264a3ad | 3 | #include "oauth.h" |
takahashim | 0:0048b264a3ad | 4 | |
takahashim | 0:0048b264a3ad | 5 | OAuth4Tw::OAuth4Tw(const char *c_key, const char *c_secret, |
takahashim | 0:0048b264a3ad | 6 | const char *t_key, const char *t_secret) |
takahashim | 0:0048b264a3ad | 7 | :consumer_key(c_key), |
takahashim | 0:0048b264a3ad | 8 | consumer_secret(c_secret), |
takahashim | 0:0048b264a3ad | 9 | token_key(t_key), |
takahashim | 0:0048b264a3ad | 10 | token_secret(t_secret) { } |
takahashim | 0:0048b264a3ad | 11 | |
takahashim | 0:0048b264a3ad | 12 | std::string OAuth4Tw::url_escape(const char *str) { |
takahashim | 0:0048b264a3ad | 13 | return oauth_url_escape(str); |
takahashim | 0:0048b264a3ad | 14 | } |
takahashim | 0:0048b264a3ad | 15 | |
takahashim | 0:0048b264a3ad | 16 | std::string OAuth4Tw::post(const char *uri, std::string postarg) { |
takahashim | 0:0048b264a3ad | 17 | |
takahashim | 0:0048b264a3ad | 18 | std::string req_url; |
takahashim | 0:0048b264a3ad | 19 | std::string postres; |
takahashim | 0:0048b264a3ad | 20 | |
takahashim | 0:0048b264a3ad | 21 | req_url = oauth_sign_url2(uri, &postarg, OA_HMAC, 0, |
takahashim | 0:0048b264a3ad | 22 | consumer_key, consumer_secret, token_key, token_secret); |
takahashim | 0:0048b264a3ad | 23 | |
takahashim | 0:0048b264a3ad | 24 | postres = oauth_http_post(req_url.c_str(), postarg.c_str()); |
takahashim | 0:0048b264a3ad | 25 | return postres; |
takahashim | 0:0048b264a3ad | 26 | } |
takahashim | 0:0048b264a3ad | 27 |