As title i have a client server application that works but now i try to redesign my software to be more elegant. So i created a Server class to create an http_listener and handle POST and GET method but after that it doesn't work anymore.In .h i have:
class Server
{ public: Server() {}
Server(utility::string_t url);
pplx::task<void> open();
pplx::task<void> close();
void handle_post(web::http::http_request message);
private:
// Error handlers
static void handle_error(pplx::task<void>& t);
// HTTP listener
web::http::experimental::listener::http_listener m_listener;
};
And in .c i have:
Server::Server(utility::string_t url) : m_listener(url)
{
m_listener.support(methods::POST, [this](http_request request){return Server::handle_post(request); });
m_listener.support(methods::GET, handle_get);
}
handle_get is defined in .c for test and it works but i'm not able to support POST method . I also tried different initialization of POST method like this:
m_listener.support(methods::GET, std::bind(&Server::handle_post, this, std::placeholders::_1));
but it doesn't work. Suggestions?