Reduce multi-level calls of req.req members
Several places access the members of `req` indirectly like
`req.req.method()`. This can be simplified as `req.method()` .
This would also make the code clearer.
Tested:
- Compiles
- Redfish service validator passes
Change-Id: Ie129564ff907cdea7ac224b1e3d80cc0dedfbd7b
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/http/http_request.hpp b/http/http_request.hpp
index a3c8fd8..53f51e6 100644
--- a/http/http_request.hpp
+++ b/http/http_request.hpp
@@ -80,6 +80,10 @@
{
return req.method();
}
+ void method(boost::beast::http::verb verb)
+ {
+ return req.method(verb);
+ }
std::string_view getHeaderValue(std::string_view key) const
{
@@ -91,6 +95,11 @@
return req[key];
}
+ void clearHeader(boost::beast::http::field key)
+ {
+ req.erase(key);
+ }
+
std::string_view methodString() const
{
return req.method_string();