Quantcast
Viewing all articles
Browse latest Browse all 4845

Commented Unassigned: http_listener CentOS6.5/Ubuntu13/14 some time can't receive message body [248]

I have a http_listener and just print all request body, but some time the body can not be received.
Comments: version:v2.1.0 gcc4.8.3/boost 1.55 on linux http_listener: listener_.support(methods::POST, std::bind(&HttpHandler::HandlePost, this, std::placeholders::_1)); listener_.support(methods::GET, std::bind(&HttpHandler::HandleGet, this, std::placeholders::_1)); listener_.support(methods::PUT, std::bind(&HttpHandler::HandlePut, this, std::placeholders::_1)); listener_.support(methods::DEL, std::bind(&HttpHandler::HandleDelete, this, std::placeholders::_1)); void HttpHandler::HandlePost(http_request message) { utility::string_t buffer = message.extract_string().get(); if (buffer.size() == 0) { std::cout << "no body" << std::endl; } else { //before is print buffer. std::cout << "has body" << std::endl; } // message.reply(status_codes::OK, Process(buffer)); } This is what I did. Request: POST /auth/auth HTTP/1.1 Accept-Language: en-US,en;q=0.8,en-US;q=0.6,en;q=0.4 Content-Type: application/json User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 Pragma: no-cache Accept: application/json Connection: keep-alive Cache-Control: no-cache Postman-Token: 536d0a3f-7222-afbd-216f-a50fbd011266 {"username":"ddd","password":"123","client_id":"this_is_test_app_id","response_type":"password"} This is wroking fine on windows8. (alway print "has body") Sometimes working sometimes not on CentOS6.5/Ubuntu13/14. When I see the server print "no body", if I do some other GET calls then POST call will be working again. I hope the problem description is clear.

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>