#ifndef NETWORK_HPP #define NETWORK_HPP #ifdef _WIN32 #include #include #include using string = std::wstring; #else #include #include using string = std::string; #endif class Request { public: Request() = delete; Request( const string &server ); ~Request(); std::string get( const string &url ); std::string post( const string &url, const std::string &data ); void addHeader( const string &header ); void clearHeader(); bool initSuccessful(); private: #ifdef _WIN32 HINTERNET _hInternet = nullptr; HINTERNET _hConnect = nullptr; std::wstring _headers = L""; #else CURL *_curl_handle = nullptr; struct curl_slist *_chunk = nullptr; const string _server; #endif }; #endif