1
0
mirror of synced 2024-12-14 00:32:52 +01:00
ImHex/plugins/libimhex/include/hex/helpers/net.hpp

30 lines
447 B
C++
Raw Normal View History

#pragma once
#include <hex.hpp>
#include <future>
#include <curl/curl.h>
#include <nlohmann/json.hpp>
namespace hex {
template<typename T>
struct Response {
u32 code;
T response;
};
class Net {
public:
Net();
~Net();
Response<std::string> getString(std::string_view url);
Response<nlohmann::json> getJson(std::string_view url);
private:
CURL *m_ctx;
};
}