Minor change in examples.

This commit is contained in:
eidheim 2015-09-04 18:09:51 +02:00
commit c6806e6fde
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,7 @@ int main() {
server.resource["^/string$"]["POST"]=[](HttpServer::Response& response, shared_ptr<HttpServer::Request> request) { server.resource["^/string$"]["POST"]=[](HttpServer::Response& response, shared_ptr<HttpServer::Request> request) {
//Retrieve string from istream (request->content) //Retrieve string from istream (request->content)
stringstream ss; stringstream ss;
request->content >> ss.rdbuf(); ss << request->content.rdbuf();
string content=ss.str(); string content=ss.str();
response << "HTTP/1.1 200 OK\r\nContent-Length: " << content.length() << "\r\n\r\n" << content; response << "HTTP/1.1 200 OK\r\nContent-Length: " << content.length() << "\r\n\r\n" << content;

View file

@ -26,7 +26,7 @@ int main() {
server.resource["^/string$"]["POST"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) { server.resource["^/string$"]["POST"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
//Retrieve string from istream (request->content) //Retrieve string from istream (request->content)
stringstream ss; stringstream ss;
request->content >> ss.rdbuf(); ss << request->content.rdbuf();
string content=ss.str(); string content=ss.str();
response << "HTTP/1.1 200 OK\r\nContent-Length: " << content.length() << "\r\n\r\n" << content; response << "HTTP/1.1 200 OK\r\nContent-Length: " << content.length() << "\r\n\r\n" << content;