Can build C++ REST SDK on Centos ?

Dec 11, 2015 at 8:46 AM
I have just view Documentation of C++ REST SDK. I see it is available on Linux(Ubuntu) so what about centos ? Can it build on centos ?
Coordinator
Dec 11, 2015 at 3:50 PM
We have heard success from other users building on CentOS, however we don't officially support it so I don't know exactly what packages you'll need to get to satisfy the dependencies.
Dec 12, 2015 at 6:39 AM
Hi roschuma,
I need http listener, http client, json.
I have already a centos server so i don't want change it to ubuntu now.
Dec 12, 2015 at 9:28 AM
Here's a How to Install on CentOS 7 post:

http://casablanca.codeplex.com/discussions/550975
Dec 13, 2015 at 2:45 PM
Hi BSalita,

I did it follow that post and server listener without error, but client cannot request to server. I don't know what happen on centos.

This is my code:


RESTServer::RESTServer(const std::string p_link)
{
std::cout << "Init server with root:" << p_link << std::endl;
LOG_INFO("Init server with root:" << p_link);
m_Listener = new  http_listener(http::uri(utility::conversions::to_string_t(p_link)));
m_Listener->support(methods::GET, RESTServer::HandleGET);
m_Listener->support(methods::POST, RESTServer::HandlePOST);
m_Listener->support(methods::PUT, RESTServer::HandlePUT);
m_Listener->support(methods::DEL, RESTServer::HandleDEL);
}

p_link: http://127.0.0.1:8888/api/testserver

Client: I use browser to connect server with method default is GET but haven't event in RESTServer::HandleGET
Dec 14, 2015 at 1:55 AM
I know why my server cannot listen because I don't wait after listen. This is my fix :

Server->Start()
while(1)
{
 std::thread::sleep_for(std:chromo::milliseconds(1000)); 
}