Use mintaka shared libraries (#1)

* Add libhv and test http client

* Remove cpp-httplib

* Update premake5.lua

* Update client.cpp

* Update premake5.lua

* Add more windows libs

* Use mintaka http client
This commit is contained in:
Guilherme Werner
2023-12-08 17:03:09 -03:00
committed by GitHub
parent 7297e2e383
commit d9c7010888
46 changed files with 26003 additions and 9522 deletions

View File

@ -8,9 +8,33 @@ namespace tribufu
{
this->id = id;
this->secret = secret;
this->http = HttpClient();
}
TribufuClient::~TribufuClient()
{
}
void TribufuClient::get_token()
{
try
{
std::string url = "https://api.tribufu.com/v1/servers";
FHttpResponse response = this->http.get(url);
std::cout << "status_code: " << response.status_code << std::endl;
if (response.body != nullptr)
{
json response_body = json::parse(response.body);
std::string json_str = response_body.dump(4);
std::cout << json_str << std::endl;
}
mintaka_http_free_response(response);
}
catch (std::exception &e)
{
std::cout << "exception: " << e.what() << std::endl;
}
}
}