Remove body member from Request
Per cpp core guidelines, these should be methods.
Tested: on last patchset of the series.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib16479db9d2b68da68e7ad6e825c7e205c64f1de
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index c56b390..e1b7f83 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -117,7 +117,7 @@
BMCWEB_LOG_DEBUG << "saveAreaDirSize: " << saveAreaDirSize;
// Get the file size getting uploaded
- const std::string& data = req.body;
+ const std::string& data = req.body();
BMCWEB_LOG_DEBUG << "data length: " << data.length();
if (data.length() < minSaveareaFileSize)
diff --git a/include/image_upload.hpp b/include/image_upload.hpp
index ab2901e..18a0c09 100644
--- a/include/image_upload.hpp
+++ b/include/image_upload.hpp
@@ -99,7 +99,7 @@
BMCWEB_LOG_DEBUG << "Writing file to " << filepath;
std::ofstream out(filepath, std::ofstream::out | std::ofstream::binary |
std::ofstream::trunc);
- out << req.body;
+ out << req.body();
out.close();
timeout.async_wait(timeoutHandler);
}
diff --git a/include/login_routes.hpp b/include/login_routes.hpp
index e3b8c19..00debb5 100644
--- a/include/login_routes.hpp
+++ b/include/login_routes.hpp
@@ -37,7 +37,8 @@
// Check if auth was provided by a payload
if (contentType.starts_with("application/json"))
{
- loginCredentials = nlohmann::json::parse(req.body, nullptr, false);
+ loginCredentials =
+ nlohmann::json::parse(req.body(), nullptr, false);
if (loginCredentials.is_discarded())
{
BMCWEB_LOG_DEBUG << "Bad json in request";
diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp
index 4824269..adeeccb 100644
--- a/include/multipart_parser.hpp
+++ b/include/multipart_parser.hpp
@@ -74,8 +74,8 @@
lookbehind.resize(boundary.size() + 8);
state = State::START;
- const char* buffer = req.body.data();
- size_t len = req.body.size();
+ const char* buffer = req.body().data();
+ size_t len = req.body().size();
char cl = 0;
for (size_t i = 0; i < len; i++)