Update Http Library

This commit is contained in:
2020-06-14 16:39:11 +02:00
parent a8381614e8
commit 86af7f0eb8
3 changed files with 30 additions and 10 deletions
+8 -3
View File
@@ -86,7 +86,8 @@ void Device::UpdateDevicesFromInventory()
{
try
{
std::string devices = m_httpClient.GetUrlContents(m_inventoryURL);
Http::HttpRequest request(m_inventoryURL);
std::string devices = m_httpClient.Open(request);
nlohmann::json json = nlohmann::json::parse(devices);
m_dynamicDevices.clear();
@@ -229,7 +230,9 @@ void Device::SendStateChange(bool present, const std::string& macAddress)
try
{
m_httpClient.GetUrlSilent(url.str());
Http::HttpRequest request(url.str());
request.ReturnType(Http::HttpRequest::ReturnType::None);
m_httpClient.Open(request);
}
catch (const std::exception& e)
{
@@ -266,7 +269,9 @@ void Device::SendStateChange(bool present, const std::string& macAddress)
{
try
{
m_httpClient.GetUrlSilent(url);
Http::HttpRequest request(url);
request.ReturnType(Http::HttpRequest::ReturnType::None);
m_httpClient.Open(request);
}
catch (const std::exception& e)
{