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:
- 3:c28b796ef7ed
- Parent:
- 2:a057c813fb02
- Child:
- 4:1ecf49a46040
diff -r a057c813fb02 -r c28b796ef7ed oauth_http.cpp
--- a/oauth_http.cpp Mon Dec 15 12:24:37 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * OAuth http functions in POSIX-C.
- *
- * Copyright 2007, 2008, 2009, 2010 Robin Gareus <robin@gareus.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "oauth.h"
-
-#include <HTTPClient.h>
-#include "HTTPPostText.h"
-
-static char res_buffer[1024] = "";
-
-/* wrapper functions */
-
-/**
- * do a HTTP POST request, wait for it to finish
- * and return the content of the reply.
- * (requires libcurl or a command-line HTTP client)
- *
- * more documentation in oauth.h
- *
- * @param u url to query
- * @param p postargs to send along with the HTTP request.
- * @return In case of an error NULL is returned; otherwise a pointer to the
- * replied content from HTTP server. latter needs to be freed by caller.
- */
-std::string oauth_http_post(const char *u, const char *p)
-{
- HTTPClient http;
- HTTPPostText req((char *)p, strlen(p) + 1);
- HTTPText res(res_buffer, sizeof(res_buffer));
- http.post(u, req, &res);
- return res_buffer;
-}
-
