#ifndef HTTPCLIENT_H
#define HTTPCLIENT_H
#include <iostream>
#include <string>
using namespace std;
class CHttpClient
{
public:
CHttpClient();
int Put(
const std::string &strUrl,
const std::string &strPost,
std::string &strResponse,
int timeout );
};
#endif // HTTPCLIENT_H
#include "httpclient.h"
#include <curl/curl.h>
#define m_bDebug 0
CHttpClient::CHttpClient()
{
}
static size_t OnWriteData(void *buffer, size_t size, size_t nmemb, void *lpVoid)
{
std::string *str = dynamic_cast<std::string *>((std::string *)lpVoid);
if (NULL == str || NULL == buffer)
{
return -1;
}
char *p