ban4jp - / OAuth4Tw

Dependents:   FlashAir_Twitter CyaSSL-Twitter-OAuth4Tw TweetTest NetworkThermometer ... more

Fork of OAuth4Tw by Masayoshi Takahashi

Revision:
1:0036880e6f71
Parent:
0:0048b264a3ad
diff -r 0048b264a3ad -r 0036880e6f71 oauth_http.cpp
--- a/oauth_http.cpp	Mon Dec 12 18:47:10 2011 +0000
+++ b/oauth_http.cpp	Sun Dec 14 07:53:41 2014 +0000
@@ -34,6 +34,9 @@
 #include "oauth.h"
 
 #include <HTTPClient.h>
+#include "HTTPPostText.h"
+
+static char res_buffer[1024] = "";
 
 /* wrapper functions */
 
@@ -52,10 +55,9 @@
 std::string oauth_http_post(const char *u, const char *p)
 {
     HTTPClient http;
-    HTTPText req("application/x-www-form-urlencoded");
-    HTTPText res;
-    req.set(p);
+    HTTPPostText req((char *)p, strlen(p) + 1);
+    HTTPText res(res_buffer, sizeof(res_buffer));
     http.post(u, req, &res);
-    return res.get();
+    return res_buffer;
 }