- SafeStringStream reply;
- reply << "HTTP/1.1 200 OK\r\n"
- << "Content-Length: " << json.str().length() << "\r\n"
- << "Content-Type: application/json\r\n"
- << "\r\n"
- << json.str () << "\r\n";
- cout << "reply: " << json.str() << "\n";
- boost::asio::write (*socket, boost::asio::buffer (reply.str().c_str(), reply.str().length()));
+ string reply = "HTTP/1.1 200 OK\r\n"
+ "Content-Length: " + raw_convert<string>(json.length()) + "\r\n"
+ "Content-Type: application/json\r\n"
+ "\r\n"
+ + json + "\r\n";
+ cout << "reply: " << json << "\n";
+ boost::asio::write (*socket, boost::asio::buffer (reply.c_str(), reply.length()));