diff options
author | Myung Bae <myungbae@us.ibm.com> | 2024-04-01 17:27:39 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-02 02:22:31 +0300 |
commit | 1873a04f43bb414408d1da9a5a775c05474603d2 (patch) | |
tree | 01859da41d4c385874e95fe28f3643049a034609 /http/http_request.hpp | |
parent | 4393bdb981d97e8db1d2cf7700a507222f14e08b (diff) | |
download | bmcweb-1873a04f43bb414408d1da9a5a775c05474603d2.tar.xz |
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>
Diffstat (limited to 'http/http_request.hpp')
-rw-r--r-- | http/http_request.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/http/http_request.hpp b/http/http_request.hpp index a3c8fd8d0e..53f51e68fd 100644 --- a/http/http_request.hpp +++ b/http/http_request.hpp @@ -80,6 +80,10 @@ struct Request { 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 @@ struct Request return req[key]; } + void clearHeader(boost::beast::http::field key) + { + req.erase(key); + } + std::string_view methodString() const { return req.method_string(); |