Skip to content

v0.2.53..v0.2.54 changeset HootServicesLanguageInfoClient.cpp

Garret Voltz edited this page Mar 31, 2020 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/language/HootServicesLanguageInfoClient.cpp b/hoot-core/src/main/cpp/hoot/core/language/HootServicesLanguageInfoClient.cpp
index 16c6455..992314e 100644
--- a/hoot-core/src/main/cpp/hoot/core/language/HootServicesLanguageInfoClient.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/language/HootServicesLanguageInfoClient.cpp
@@ -22,20 +22,21 @@
  * This will properly maintain the copyright information. DigitalGlobe
  * copyrights will be updated automatically.
  *
- * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
  */
 
 #include "HootServicesLanguageInfoClient.h"
 
 // hoot
+#include <hoot/core/auth/HootServicesLoginManager.h>
+#include <hoot/core/io/HootNetworkRequest.h>
+#include <hoot/core/io/NetworkIoUtils.h>
+#include <hoot/core/util/ConfigOptions.h>
+#include <hoot/core/util/Factory.h>
 #include <hoot/core/util/HootException.h>
+#include <hoot/core/util/HootNetworkUtils.h>
 #include <hoot/core/util/Log.h>
-#include <hoot/core/util/ConfigOptions.h>
 #include <hoot/core/util/StringUtils.h>
-#include <hoot/core/util/Factory.h>
-#include <hoot/core/io/HootNetworkRequest.h>
-#include <hoot/core/io/NetworkIoUtils.h>
-#include <hoot/core/auth/HootServicesLoginManager.h>
 
 // Qt
 #include <QVariant>
@@ -129,7 +130,7 @@ std::shared_ptr<boost::property_tree::ptree> HootServicesLanguageInfoClient::get
    const QString errorMsg = e.what();
    throw HootException("Error getting available translation apps. error: " + errorMsg);
  }
- if (request.getHttpStatus() != 200)
+ if (request.getHttpStatus() != HttpResponseCode::HTTP_OK)
  {
    throw HootException(QString("Reply error:\n%1").arg(request.getErrorString()));
  }
@@ -158,7 +159,7 @@ std::shared_ptr<boost::property_tree::ptree> HootServicesLanguageInfoClient::get
 
   QUrl url(urlStr);
   QMap<QNetworkRequest::KnownHeaders, QVariant> headers;
-  headers[QNetworkRequest::ContentTypeHeader] = "application/json";
+  headers[QNetworkRequest::ContentTypeHeader] = HootNetworkUtils::CONTENT_TYPE_JSON;
   HootNetworkRequest request;
   if (_useCookies)
   {
@@ -175,7 +176,7 @@ std::shared_ptr<boost::property_tree::ptree> HootServicesLanguageInfoClient::get
     const QString errorMsg = e.what();
     throw HootException("Error getting available translation languages. error: " + errorMsg);
   }
-  if (request.getHttpStatus() != 200)
+  if (request.getHttpStatus() != HttpResponseCode::HTTP_OK)
   {
     throw HootException(QString("Reply error:\n%1").arg(request.getErrorString()));
   }
Clone this wiki locally