Add first work package for REST API implementation
[anna.git] / example / diameter / launcher / MyHandler.hpp
index 5f04d91..9e849a3 100644 (file)
@@ -12,6 +12,7 @@
 // Project
 #include <anna/http/Response.hpp>
 #include <anna/http/Handler.hpp>
+#include <anna/json/json.hpp>
 
 
 class MyHandler : public anna::http::Handler {
@@ -21,9 +22,15 @@ public:
   }
 
 private:
+  void splitURI(const std::string &uri, std::string &operation, std::string & param1, std::string & param2) const;
+
+  void sendResponse(anna::comm::ClientSocket&, anna::http::Response *response);
+  bool doGET(const std::string &uri, std::string &response);
+  bool doPOST(const std::string &uri, const nlohmann::json &j, std::string &reponse);
 
   void evRequest(anna::comm::ClientSocket&, const anna::http::Request& request) throw(anna::RuntimeException);
   void evResponse(anna::comm::ClientSocket&, const anna::http::Response&) throw(anna::RuntimeException) {;}
 };
 
 #endif
+