Fixed compatibility for HTTPClient Library. (HTTPClient by Donatien Garnier)

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

Fork of OAuth4Tw by Masayoshi Takahashi

OAuth4Tw.h

Committer:
ban4jp
Date:
2015-07-14
Revision:
5:5146becb651f
Parent:
4:1ecf49a46040

File content as of revision 5:5146becb651f:

#ifndef MBED_OAUTH4TW_H
#define MBED_OAUTH4TW_H

#include "mbed.h"
#include "HTTPClient.h"
#include <vector>
#include <string>

class OAuth4Tw
{
public:
    OAuth4Tw(const char *c_key, const char *c_secret,
             const char *t_key, const char *t_secret);

    static std::string url_escape(const char *str);

    HTTPResult get(const char *url, IHTTPDataIn* response, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT);

    HTTPResult post(const char *url, IHTTPDataIn* response, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT);
    HTTPResult post(const char *url, std::vector<std::string> *postdata, IHTTPDataIn* response, int timeout = HTTP_CLIENT_DEFAULT_TIMEOUT);

private:
    const char *consumer_key;
    const char *consumer_secret;
    const char *token_key;
    const char *token_secret;
};

#endif