Minor change in examples.
This commit is contained in:
parent
e78b321914
commit
c6806e6fde
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue