BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
HTTPEntireResponse.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <Poco/Net/HTTPResponse.h>
6 
7 namespace BeeeOn {
8 
9 /*
10  * @brief The class is derivated from Poco::Net::HTTPResponse
11  * and allows to keep response body.
12  */
13 class HTTPEntireResponse : public Poco::Net::HTTPResponse {
14 public:
16 
17  /*
18  * @brief Move semantics allows to return HTTPEntireResponse instance
19  * from methods without unnecessary copying of headers or body contents.
20  */
22  HTTPEntireResponse(Poco::Net::HTTPResponse::HTTPStatus status);
23  HTTPEntireResponse(Poco::Net::HTTPResponse::HTTPStatus status, const std::string& reason);
24  HTTPEntireResponse(const std::string& version, Poco::Net::HTTPResponse::HTTPStatus status);
25  HTTPEntireResponse(const std::string& version, Poco::Net::HTTPResponse::HTTPStatus status, const std::string& reason);
27 
28  HTTPEntireResponse& operator=(HTTPEntireResponse&& other);
29 
30  void readBody(std::istream& istr);
31  void setBody(const std::string& body);
32  std::string getBody() const;
33 
34 private:
35  std::string m_body;
36 };
37 
38 }
Definition: HTTPEntireResponse.h:13