diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-06-21 19:55:06 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-06-21 19:55:06 +0200 |
commit | ec7cfa85530082127703278cf1ae5167990c0f45 (patch) | |
tree | 81799c532da3c213609471cfcfa785bfda3b2ee0 /src/RequestResponse.hpp | |
parent | 93d69841064fd5c3156d989caf7ddec46bfb8685 (diff) |
Request/Response handling w/ libevent2
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/RequestResponse.hpp')
-rw-r--r-- | src/RequestResponse.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/RequestResponse.hpp b/src/RequestResponse.hpp new file mode 100644 index 0000000..24577aa --- /dev/null +++ b/src/RequestResponse.hpp @@ -0,0 +1,28 @@ +#ifndef REQUEST_RESPONSE_H +#define REQUEST_RESPONSE_H 1 + +#include <event2/http.h> + +#include <string> + +class RequestResponse { +public: + RequestResponse(struct evhttp_request * const req); + ~RequestResponse(); + + void UseInputHeader(); + void UseOutputHeader(); + + bool AddOutputHeader(std::string & key, std::string & value); + bool AddOutputHeader2(std::string key, std::string value); + + bool GetInputHeader(std::string & key, std::string & value); + bool GetInputHeader2(std::string key, std::string value); + +private: + struct evhttp_request * const m_Request; + struct evkeyvalq * m_InputHeader; + struct evkeyvalq * m_OutputHeader; +}; + +#endif |