| 1234567891011121314151617181920212223242526272829303132333435 |
- #pragma once
- // curl
- #define USE_OPENSSL
- #define CURL_STATICLIB
- #include <curl/curl.h>
- #pragma comment(lib, "ws2_32.lib")
- #pragma comment(lib, "wldap32.lib")
- #pragma comment(lib, "libcurl.lib")
- #pragma comment(lib,"Crypt32.lib")
- #include <json/json.h>
- #pragma comment(lib,"jsoncpp_static.lib")
- class CHttpClient
- {
- public:
- BOOL sendWarnMsg(const char* postParams);
- CURLcode curl_post_req(const char* url, const char* postParams, std::string &response);
- static CHttpClient* GetInStance() { return &sp; }
- private:
- CHttpClient() {};
- CHttpClient(const CHttpClient&);
- CHttpClient& operator = (const CHttpClient&) = delete;
- ~CHttpClient() {};
- static size_t req_reply(void * ptr, size_t size, size_t nmemb, void * stream);
- static CHttpClient sp;
- };
|