|
|
@@ -1,5 +1,5 @@
|
|
|
#include "Device.h"
|
|
|
-#include "Util/JSON.h"
|
|
|
+#include <json.hpp>
|
|
|
#include <Logging.h>
|
|
|
#include <algorithm>
|
|
|
#include <sstream>
|
|
|
@@ -59,7 +59,7 @@ bool Device::Login()
|
|
|
std::stringstream url;
|
|
|
url << "https://" << m_hostname << ":" << m_port << "/api/login";
|
|
|
|
|
|
- Util::JSON json;
|
|
|
+ nlohmann::json json;
|
|
|
json["password"] = m_password;
|
|
|
json["username"] = m_username;
|
|
|
|
|
|
@@ -71,7 +71,7 @@ bool Device::Login()
|
|
|
std::stringstream output;
|
|
|
output << m_httpClient.GetUrlPostContents(url.str(), headers, m_cookieFile, json.dump());
|
|
|
|
|
|
- Util::JSON outputJSON = Util::JSON::parse(output);
|
|
|
+ nlohmann::json outputJSON = nlohmann::json::parse(output);
|
|
|
|
|
|
if (outputJSON["meta"]["rc"] != "ok")
|
|
|
{
|
|
|
@@ -154,7 +154,7 @@ void Device::UpdateDevicesFromInventory()
|
|
|
try
|
|
|
{
|
|
|
std::string devices = m_httpClient.GetUrlContents(m_inventoryURL);
|
|
|
- Util::JSON json = Util::JSON::parse(devices);
|
|
|
+ nlohmann::json json = nlohmann::json::parse(devices);
|
|
|
|
|
|
m_devices.clear();
|
|
|
for (auto& element : json)
|
|
|
@@ -198,7 +198,7 @@ void Device::UpdatePresentDevices()
|
|
|
std::stringstream output;
|
|
|
output << m_httpClient.GetUrlContents(url.str(), m_cookieFile);
|
|
|
|
|
|
- Util::JSON json = Util::JSON::parse(output);
|
|
|
+ nlohmann::json json = nlohmann::json::parse(output);
|
|
|
|
|
|
if (json["meta"]["rc"] != "ok")
|
|
|
{
|