12345678910111213141516171819202122232425262728293031 |
- #ifndef CURLHTTP_H
- #define CURLHTTP_H
- #include <string>
- #include <vector>
- #include "curl/curl.h"
- class CurlHttp
- {
- public:
- CurlHttp();
- ~CurlHttp();
- /* 获取信息 */
- static bool Get(const std::string& url, std::string& response);
- /* 获取信息,带有http头 */
- static bool Get(const std::string& url, const std::vector<std::string>& vecHeader, std::string& response);
- /* 发送信息,带有包体 */
- static bool Post(const std::string& url, const std::string& postData, std::string& response);
- /* 发送带有Http头和包体的信息 */
- static bool Post(const std::string& url, const std::vector<std::string>& vecHeader, const std::string& postData, std::string& response);
- };
- #endif /* CURLHTTP_H */
|