i listen on :
with:
i run in the console
but even if i do something like:
i just don't know how to implement this with casablanca
with:
const http::uri uri = http::uri::encode_uri(utility::conversions::to_string_t(theUri));
new VlHttp(uri);
and the constructor VlHttp lokks like this:VlHttp::VlHttp(const http::uri& url) : m_listener(http_listener(url))
{
printf("url is: %s\n", url.to_string().c_str());
m_listener.support(methods::GET,
std::tr1::bind(&VlHttp::handle_get,
this,
std::tr1::placeholders::_1));
m_listener.support(methods::PUT,
std::tr1::bind(&VlHttp::handle_put,
this,
std::tr1::placeholders::_1));
m_listener.support(methods::POST,
std::tr1::bind(&VlHttp::handle_post,
this,
std::tr1::placeholders::_1));
m_listener.support(methods::DEL,
std::tr1::bind(&VlHttp::handle_delete,
this,
std::tr1::placeholders::_1));
try
{
m_listener
.open()
//.then([&m_listener](){TRACE(L"\nstarting to listen\n"); })
.wait();
while (true);
}
catch (exception const & e)
{
printf("%s", e.what());
wcout << e.what() << endl;
}
}
Here is what i havei run in the console
handle GET
path: °þZ☻
fragment: ÈþZ☻
query: ░þZ☻
i guess its somekind of encoded or stream thing?but even if i do something like:
-
utility::conversions::to_utf8string
it does not work
-
path.c_str();
it returns an empty string
$_SERVER['REQUEST_URI'];
and i would run a dispatcher matching classes / methods against the fragments.i just don't know how to implement this with casablanca