Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: FlashAir_Twitter CyaSSL-Twitter-OAuth4Tw TweetTest NetworkThermometer ... more
Fork of OAuth4Tw by
Diff: oauth_http.cpp
- 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;
}
