18 #ifndef NAF_HTTP_COMMONRESPONSES
19 #define NAF_HTTP_COMMONRESPONSES
25 #include <Poco/Net/HTTPServerResponse.h>
26 #include <Poco/JSON/JSON.h>
27 #include <Poco/JSON/Object.h>
29 #include "nebulaatomConfig.h"
30 #include "files/file_manager.h"
31 #include "http/request.h"
38 enum class ResponseType;
40 class CommonResponses;
45 using namespace Poco::Net;
48 enum class NAF::HTTP::ResponseType
56 enum class NAF::HTTP::Status
59 ,kHTTP_BAD_REQUEST = 400
60 ,kHTTP_UNAUTHORIZED = 401
61 ,kHTTP_FORBIDDEN = 403
62 ,kHTTP_NOT_FOUND = 404
63 ,kHTTP_INTERNAL_SERVER_ERROR = 500
64 ,kHTTP_BAD_GATEWAY = 502
65 ,kHTTP_SERVICE_UNAVAILABLE = 503
73 HTTPResponse::HTTPStatus http_status;
75 ResponseType response_type;
82 std::map<HTTP::Status, Attributes>& get_responses_()
84 auto& var = responses_;
88 void CompoundResponse_(HTTP::Status status, JSON::Object::Ptr result_json);
89 void CompoundFillResponse_(HTTP::Status status, JSON::Object::Ptr result_json, std::string message);
90 void JSONResponse_(HTTP::Status status, std::string message);
91 void HTMLResponse_(HTTP::Status status, std::string message);
92 void CustomHTMLResponse_(HTTP::Status status, std::string html_message);
93 void FileResponse_(HTTP::Status status, std::string address);
96 void FillResponses_();
97 void FillStatusMessage_(JSON::Object::Ptr json_object, HTTP::Status status, std::string message);
100 std::map<HTTP::Status, Attributes> responses_;
Definition: common_responses.h:69
Definition: common_responses.h:72