diff --git a/external/3rd/library/webAPI/webAPI.cpp b/external/3rd/library/webAPI/webAPI.cpp index 7a2a873c..a572d9d4 100644 --- a/external/3rd/library/webAPI/webAPI.cpp +++ b/external/3rd/library/webAPI/webAPI.cpp @@ -1,5 +1,5 @@ /* - * Version: 1.3 + * Version: 1.5 * * This code is just a simple wrapper around nlohmann's wonderful json lib * (https://github.com/nlohmann/json) and libcurl. While originally included directly, @@ -56,7 +56,8 @@ std::string webAPI::getString(const std::string &slot) { } std::vector webAPI::getStringVector(const std::string &slot) { - if (!this->responseData.empty() && !slot.empty() && responseData.count(slot) && !this->responseData[slot].is_null()) { + if (!this->responseData.empty() && !slot.empty() && responseData.count(slot) && + !this->responseData[slot].is_null()) { return this->responseData[slot].get>(); } @@ -107,7 +108,8 @@ bool webAPI::fetch(const int &getPost, const int &mimeType) // 0 for json 1 for slist = curl_slist_append(slist, "charsets: utf-8"); curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeCallback); // place the data into readBuffer using writeCallback + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, + writeCallback); // place the data into readBuffer using writeCallback curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); // specify readBuffer as the container for data curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist); diff --git a/external/3rd/library/webAPI/webAPI.h b/external/3rd/library/webAPI/webAPI.h index 9ca0c20e..cd9a6a4c 100644 --- a/external/3rd/library/webAPI/webAPI.h +++ b/external/3rd/library/webAPI/webAPI.h @@ -1,5 +1,5 @@ /* - * Version: 1.4 + * Version: 1.5 * * This code is just a simple wrapper around nlohmann's wonderful json lib * (https://github.com/nlohmann/json) and libcurl. While originally included directly, @@ -23,7 +23,9 @@ #ifdef WIN32 #include #else + #include + #endif namespace StellaBellum { @@ -45,7 +47,8 @@ namespace StellaBellum { ~webAPI(); // submits the request - bool submit(const int &reqType = DTYPE::JSON, const int &getPost = HTTP::POST, const int &respType = DTYPE::JSON); + bool + submit(const int &reqType = DTYPE::JSON, const int &getPost = HTTP::POST, const int &respType = DTYPE::JSON); // set the endpoint after object creation...or change the target if needed bool setEndpoint(const std::string endpoint); @@ -63,7 +66,8 @@ namespace StellaBellum { std::vector getStringVector(const std::string &slot); // set json key and value for request - template bool addJsonData(const std::string &key, const T &value) { + template + bool addJsonData(const std::string &key, const T &value) { if (!key.empty() && responseData.count(key) == 0) // only alow one of a given key for now, unless we support nesting later { @@ -75,7 +79,8 @@ namespace StellaBellum { } // get json response slot - template T getNullableValue(const std::string &slot) { + template + T getNullableValue(const std::string &slot) { if (!this->responseData.empty() && !slot.empty() && responseData.count(slot)) { return this->responseData[slot].get(); }