1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef example_diameter_launcher_MyHandler_hpp
10 #define example_diameter_launcher_MyHandler_hpp
13 #include <anna/http/Response.hpp>
14 #include <anna/http/Handler.hpp>
15 #include <anna/json/json.hpp>
18 class MyHandler : public anna::http::Handler {
20 MyHandler() : anna::http::Handler("http_converter::MyHandler") {
21 allocateResponse()->createHeader(anna::http::Header::Type::Date);
25 void splitURI(const std::string &uri, std::string &operation, std::string & param1, std::string & param2) const;
27 void sendResponse(anna::comm::ClientSocket&, anna::http::Response *response);
28 bool doGET(const std::string &uri, std::string &response);
29 bool doPOST(const std::string &uri, const nlohmann::json &j, std::string &reponse);
31 void evRequest(anna::comm::ClientSocket&, const anna::http::Request& request) throw(anna::RuntimeException);
32 void evResponse(anna::comm::ClientSocket&, const anna::http::Response&) throw(anna::RuntimeException) {;}