-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.53..v0.2.54 changeset HootServicesTranslatorClient.cpp
Garret Voltz edited this page Mar 31, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/language/HootServicesTranslatorClient.cpp b/hoot-core/src/main/cpp/hoot/core/language/HootServicesTranslatorClient.cpp
index 2027c97..ac163ed 100644
--- a/hoot-core/src/main/cpp/hoot/core/language/HootServicesTranslatorClient.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/language/HootServicesTranslatorClient.cpp
@@ -22,21 +22,22 @@
* 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 "HootServicesTranslatorClient.h"
// hoot
-#include <hoot/core/util/HootException.h>
-#include <hoot/core/util/Log.h>
+#include <hoot/core/auth/HootServicesLoginManager.h>
+#include <hoot/core/io/HootNetworkRequest.h>
+#include <hoot/core/io/NetworkIoUtils.h>
+#include <hoot/core/language/LanguageUtils.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/StringUtils.h>
-#include <hoot/core/io/HootNetworkRequest.h>
-#include <hoot/core/io/NetworkIoUtils.h>
-#include <hoot/core/auth/HootServicesLoginManager.h>
-#include "LanguageUtils.h"
// Qt
#include <QByteArray>
@@ -340,7 +341,7 @@ QString HootServicesTranslatorClient::translate(const QString& text)
QUrl url(_getTranslateUrl());
QMap<QNetworkRequest::KnownHeaders, QVariant> headers;
- headers[QNetworkRequest::ContentTypeHeader] = "application/json";
+ headers[QNetworkRequest::ContentTypeHeader] = HootNetworkUtils::CONTENT_TYPE_JSON;
HootNetworkRequest request;
if (_useCookies)
{
@@ -357,7 +358,7 @@ QString HootServicesTranslatorClient::translate(const QString& text)
{
throw HootException("Error translating text: " + text + ". error: " + e.what());
}
- if (request.getHttpStatus() != 200)
+ if (request.getHttpStatus() != HttpResponseCode::HTTP_OK)
{
throw HootException("Error translating text: " + text + ". error: " + request.getErrorString());
}