Hi all. I tried to create http_listener but all stop in .open function, why? (Windows 7, VS 2013)
Please help.
Please help.
#include <cpprest\http_listener.h>
#include <cpprest\http_client.h>
#include <iostream>
using namespace std;
using namespace web; // Common features like URIs.
using namespace web::http; // Common HTTP functionality
using namespace web::http::client;
using namespace web::http::experimental::listener;
void get_handle(http_request resp)
{
}
int main(int argc, char** argv)
{
http_listener listener(U("http://127.0.0.1:8181"));
listener.support(methods::GET, get_handle);
listener.open().then([&listener]()
{
cout << "Server start" << endl;
listener.close();
}).wait();
cout << "Listener stop" << endl;
system("pause");
return 0;
}