tv_rename/network.hpp

39 lines
590 B
C++

#ifndef NETWORK_HPP
#define NETWORK_HPP
#ifdef _WIN32
#include <WinInet.h>
#include <Windows.h>
using string = std::wstring;
#else
#include <curl/curl.h>
#include <string>
using string = std::string;
#endif
class Curl {
public:
Curl();
~Curl();
std::string get( const string &url );
std::string post( const std::string &url, const std::string &data );
void addHeader( const std::string &header );
void clearHeader();
private:
#ifdef _WIN32
HINTERNET connect = nullptr;
#else
CURL *curl_handle;
struct curl_slist *chunk = NULL;
#endif
};
#endif