summaryrefslogtreecommitdiff
path: root/http/http_request.hpp
diff options
context:
space:
mode:
authorWilly Tu <wltu@google.com>2021-12-14 22:03:16 +0300
committerWilly Tu <wltu@google.com>2022-02-25 01:27:07 +0300
commit15ed678014998b3344c07de3a91e6855e6bd509b (patch)
treeb997cce4ef306fee482ec931949b741cd78be180 /http/http_request.hpp
parent6bbda2ca7211b58c759d444442436b782fe294cd (diff)
downloadbmcweb-15ed678014998b3344c07de3a91e6855e6bd509b.tar.xz
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty input will use the default value based on the implementation and return 200 OK response code. readJsonPatch will replace the existing readJson and be used for path requests. It will not allow empty json input and all requested keys are required in the json input. readJsonAction will be used for Action requests where it is possible for all of the properties to be optional and allow empty request. The optional properties are determined by the requested values type. All current Action readJson are replaced with readJsonAction. It does not change the existing behavior since it needs `std::optional`. This will have to be updated later as we define the default behavior. Tested: Added unit tests and readJsonAction allows empty empty json object. No Change to Redfish Tree. Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea Signed-off-by: Willy Tu <wltu@google.com>
Diffstat (limited to 'http/http_request.hpp')
-rw-r--r--http/http_request.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/http/http_request.hpp b/http/http_request.hpp
index e0cb9dc3ed..cb7b71bfa2 100644
--- a/http/http_request.hpp
+++ b/http/http_request.hpp
@@ -26,7 +26,7 @@ struct Request
bool isSecure{false};
- const std::string& body;
+ std::string& body;
boost::asio::io_context* ioService{};
boost::asio::ip::address ipAddress{};